[LUAU] rsync question

Brian Chee chee at hawaii.edu
Thu Aug 28 14:43:16 PDT 2014


Nice, thanks Vince...the man pages are more than a little confusing on this
topic but logically the -delete option should mean that the default is no
delete. I should have just done a test case (like you did) so thanks for
the sledge hammer over the head.

/brian chee



On Thu, Aug 28, 2014 at 12:01 AM, Vince Hoang <vince at litrium.com> wrote:

> The files are only removed when —delete is passed. Let’s verify:
>
>
>
>
>
> foo$ mkdir src dst
>
> foo$ touch src/{1,2,3,4,5}
>
> foo$ rsync -av src/ dst/
>
> building file list ... done
>
> ./
>
> 1
>
> 2
>
> 3
>
> 4
>
> 5
>
>
>
>
> sent 328 bytes  received 136 bytes  928.00 bytes/sec
>
> total size is 0  speedup is 0.00
>
> foo$ rm src/{1,3,5}
>
> foo$ rsync -av src/ dst/
>
> building file list ... done
>
> ./
>
>
>
>
> sent 101 bytes  received 26 bytes  254.00 bytes/sec
>
> total size is 0  speedup is 0.00
>
> foo$ ls -1 src
>
> 2
>
> 4
>
> foo$ ls -1 dst
>
> 1
>
> 2
>
> 3
>
> 4
>
> 5
>
> foo$ rsync -av --delete src/ dst/
>
> building file list ... done
>
> deleting 5
>
> deleting 3
>
> deleting 1
>
> ./
>
>
>
>
> sent 101 bytes  received 26 bytes  254.00 bytes/sec
>
> total size is 0  speedup is 0.00
>
> foo$ ls -1 dst
>
> 2
>
> 4
>
> foo$
>
>
>
>
>
>
>
> -Vince
>
>
>
>> Sent from Mailbox
>
> On Wed, Aug 27, 2014 at 7:24 PM, Brian Chee <chee at hawaii.edu> wrote:
>
> > I thought so too, but all the docs I've been finding seems to indicate
> that
> > it deletes....which doesn't work for me.
> > Brian chee
> >  On Aug 27, 2014 6:34 PM, "Dwight Victor (Gmail)" <
> dwight.victor at gmail.com>
> > wrote:
> >> isn't the default behavior to keep files on the target?  i think you
> have
> >> to use the --delete option to force delete from the target.
> >>
> >>> So I'm trying to find if rsync has an option to NOT delete remote
> files if
> >>> they're no longer on the local machine.
> >>>
> >>> The issue is that I can't afford to lose any data off my sensors. I've
> got
> >>> the remote server mounted in fstab so that it looks like two local
> >>> directories.
> >>>
> >>> I want to make sure everything in the local directory is copied and
> synced
> >>> (updated) to the remote. But if someone deletes a file on the local
> >>> machine
> >>> but the file exists on the remote side, I don't want that remote file
> >>> deleted.
> >>>
> >>> I've been searching like crazy, but rsync always seems to want to
> delete
> >>> the remote file.
> >>>
> >>> Should I consider something other than rsync?
> >>>
> >>> /brian chee
> >>>
> >>>
> >>>
> >> _______________________________________________
> >> LUAU at lists.freesoftwarehawaii.org mailing list
> >> http://lists.freesoftwarehawaii.org/listinfo.cgi/luau-
> >> freesoftwarehawaii.org
> >>
> > _______________________________________________
> > LUAU at lists.freesoftwarehawaii.org mailing list
> >
> http://lists.freesoftwarehawaii.org/listinfo.cgi/luau-freesoftwarehawaii.org
> _______________________________________________
> LUAU at lists.freesoftwarehawaii.org mailing list
>
> http://lists.freesoftwarehawaii.org/listinfo.cgi/luau-freesoftwarehawaii.org
>



-- 
********************************************
University of Hawaii SOEST
Advanced Network Computing Laboratory (ANCL)
Brian Chee <chee at hawaii.edu>
2525 Correa Road, HIG 500
Honolulu, HI 96822
Office: 808-956-5797


More information about the LUAU mailing list