[LUAU] rsync question
Vince Hoang
vince at litrium.com
Thu Aug 28 03:01:37 PDT 2014
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
More information about the LUAU
mailing list