Potential new option: --filter

Wayne Davison wayned at samba.org
Fri Jan 21 19:36:13 GMT 2005


Another potential new option that I've been working on is the --filter
command.  The idea is to improve the include/exclude system in a way
that makes it extensible without losing backward compatibility with old
include/exclude files, and I've come to the decision that the best way
to do this is to use a new option, --filter (-f), rather than creating
a syntax for the existing include/exclude files that can cause
compatibility problems.

Filter rules always have a prefix (which makes them extensible in the
future).  The simplest rules are the normal include/exclude ones ("+ ",
"- ").  The other two rules I created are (1) a merge-file rule (think
"include file" in the C sense of the word "include") that lets you nest
filter files inside each other, and (2) a per-directory merge-file rule
that lets rsync find filter files that are sprinkled throughout the
hierarchy.  These per-dir filter files can create inherited rules, so
there is a way to ask for rsync to scan for filter files above the
transfer's start.  The simplest such rule is the new -F option, which
tells rsync to look for the file .rsync-filter in all the parent
directories of the transfer (which is never outside a module's "path"
for a daemon rsync).  See the revised man page for full details.
See also the "filter" setting in the rsyncd.conf man page.

You can see a quick summary of the new filter-rule syntax at the top of
the patch file:

    http://rsync.samba.org/ftp/unpacked/rsync/patches/filter.diff

To try it out, download either the latest "nightly" tar file or the CVS
version and apply the patch ("patch -p0 <patches/filter.diff"):

    http://rsync.samba.org/download.html

Thoughts?  I'm interested in getting feedback on how people like the
idea, and also on the chosen rule syntax (which is a little cryptic,
so I'm considering changing it).

..wayne..


More information about the rsync mailing list