Platform variations with --exclude-from

Joseph L. Casale jcasale at
Mon May 27 10:51:32 MDT 2013

>> 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.

Ah, I misunderstood this.

>> 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.

I'd love to say I tried that but obviously not. Thanks for the insight.

Much appreciated Paul,

More information about the rsync mailing list