Excluding/Hiding a local, absolute path in 3.0.7

Ryan Flannery ryan.flannery at gmail.com
Wed Feb 3 16:16:32 MST 2010


I'm attempting to update many of my rsync scripts and was trying to
hide/exclude absolute files/directories from being sync'd.  After
reading through the man page section on FILTER RULES, their modifiers,
etc., and the mailing list, it seems like the following simple example
should work.

I'm using the example from the man-page, where it talks about
excluding /etc/passwd.  In all variants I try, the file is

The command I'm using is this:
   rsync -avz --delete --delete-excluded --exclude-from=foo.txt  /etc/

Where foo.txt contains either:
   hide,/ /etc/passwd
   hide,/s /etc/passwd
   -/ /etc/passwd
   -/s /etc/passwd

In either case, the file /etc/passwd is always transferred to $dest:path

In the example above, I could easily just use an exclude of "passwd"
(or change the source listed in the command to /), and that works,
however in general I cannot seem to get hiding/excluding of absolute
files/directories on the local (sending-side) working.

Is my understanding that this should be working correct, or do I need
a cluestick?

Also, in the changelog/NEWS for the 3.0.7 release, I saw the following:
   An absolute-path filter rule (i.e. with a '/' modifier) no longer loses
   its modifier when sending the filter rules to the remote rsync.

Does this mean that when using the '/' modifier, the 's' modifier must
also be used if we only want the matching to take place on the local
side? (and similar for 'r'/remote-side).

Many Thanks for any help,

ryan at barwise> rsync --version
rsync  version 3.0.7  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
    64-bit files, 32-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, no ACLs, no xattrs, no iconv, no symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

ryan at barwise> uname -a
OpenBSD barwise.sapiosoft.com 4.7 GENERIC.MP#78 amd64

Also, the mailing list post where I first got the idea:

More information about the rsync mailing list