How to sync an exact list of files, Including deletes!?

Axel Kittenberger axkibe at gmail.com
Tue Nov 23 18:28:55 MST 2010


>> $ /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?
>
> Rsync always creates the destination directory; there is no way to stop
> that.  I would suggest using /tmp/ltest.WOS/trg/ as the destination
> directory in combination with --relative.

Umm thank you, sorry for yet another qeustion, if I want to add a
filter with it as -delete-missing-args isnt out there yet, I've to
make incremental rules for this, right? For example to delete
./n/c/d/y

$ /usr/bin/rsync --relative --delete --force --include-from=-
--exclude=* /tmp/ltest.WQS/src/./n/c/d/ /tmp/ltest.WQS/trg/ < cat "#
n/
n/c/
n/c/d/
n/c/d/y/***"

In that case i could save --relative away,as its filtered anyway, or?


More information about the rsync mailing list