How to sync an exact list of files, Including deletes!?
Axel Kittenberger
axkibe at gmail.com
Tue Nov 23 15:35:40 MST 2010
> You want the --delete-missing-args option of the current development
> rsync.
Yes, I suppose I want that! :-) I hope this works with --force as well
if there is a dir in --files-from? But futher supposing it takes quite
a long time until I can suppose every user with medicore updateness
has a rsync installed that can do this. For now I made it in ssh-less
pure rsync-mode to call rsync once for with --files-from for all files
that created/changed, and then for every directory in which stuff has
been deleted/movedfrom.
I got another question tough running extensive tests, the daemon
happens to do this once in a while if creates/deletes/moves piling up
faster than inotify tracks, it calls rsync for a source->destination
pair, where the source dir no longer exists, normally would be no
problem:
$ /usr/bin/rsync -vP -d /tmp/ltest.WQS/src//n/c/d/ /tmp/ltest.WQS/trg//n/c/d/
building file list ...
rsync: change_dir "/tmp/ltest.WQS/src//n/c/d" failed: No such file or
directory (2)
0 files to consider
created directory /tmp/ltest.WQS/trg//n/c/d
I expect rsync to just fail in that case, but it creates the target
directory nevertheless :-( Is there some parameter I can add to rsync
so it wont create directories on the target, if there isnt a source
directory for it?
Kind regards, Axel
On Sun, Nov 21, 2010 at 2:53 AM, Matt McCutchen <matt at mattmccutchen.net> wrote:
> On Sat, 2010-11-20 at 22:56 +0100, Axel Kittenberger wrote:
>> While running, Lsyncd knows exactly which files need transfer and
>> rsync's --files-from (with =- to get the filelist from stdin-pipe)
>> sounds like an ideal solution for this, also to reduce the number of
>> times rsync gets spawned. Coded that, now in beta stage there is a
>> nasty problem, rsync refuses to accept deletions that way!
>>
>> It says e.g. "rsync: link_stat "/tmp/ltest.M2e/src/z/t/fq" failed: No
>> such file or directory (2)" and refuses to delete the file on the
>> target.
>>
>> What good solutions can you suggest?
>
> You want the --delete-missing-args option of the current development
> rsync.
>
> --
> Matt
>
>
More information about the rsync
mailing list