Platform variations with --exclude-from

Paul Slootman paul+rsync at wurtel.net
Mon May 27 08:02:52 MDT 2013


On Mon 27 May 2013, Joseph L. Casale wrote:

> On Linux, an rsync command and exclude_file contents of:
> 
> # cat exclude_file
> /etc/alsa
> # rsync -a --delete --delete-excluded --exclude-from=exclude_file /etc server::module
> 
> properly excludes /etc/alsa but not any file within /etc's directories that is named alsa.

Here the exclude file's contents matches the path you've given:
root is /, path is etc so /etc/alsa matches.


> On Windows I don't seem to be able to reliably emulate this:
> 
> C:\Scripts\Backup\rsyncd>type rsyncd_exclude
> /cygdrive/d/$RECYCLE.BIN
> /cygdrive/d/Exclude
> /cygdrive/d/Inetpub
> /cygdrive/d/System Volume Information
> C:\Program Files (x86)\cwRsync\bin>rsync -a --delete --delete-excluded --exclude-from=exclude_file /cygdrive/d server::module

Here the exclude files are also anchored at the filesystem root,
but the transfer root is /cygdrive/

If you change the excludes to /d/$RECYCLE.BIN etc. (i.e. remove the
leading /cygdrive) then it should work.

That you're seeing this on windows is irrevelant, a similar setup on
linux (e.g. transferring /etc/network and excluding
/etc/network/interfaces) will also fail to do what you want.


Paul


More information about the rsync mailing list