protect rule prevents file sending when in merge filter file?

Wayne Davison wayned at samba.org
Wed Sep 14 00:28:29 MDT 2011


On Tue, Sep 13, 2011 at 12:09 PM, Lassi Tuura <lat at cern.ch> wrote:

> Whether it's a bug, could anyone suggest an alternative rule set
> which would allow us to achieve our goal here so we can work with 3.0.x
> rsync?
>

The problem is your use of --delete-excluded, which is an old option from
the days prior to filter files.  The way that --delete-excluded is
implemented, it adds an 's' (sender-side) modifier to all the
include/exclude/filter options that you specify on the command-line (unless
the command-line filter option has an explicit side specified).  Thus
--exclude=foo turns into --filter='-s foo' and --exclude-from=FILE turns
into a (relaxed-prefix) --filter="merge,s FILE" rule.  In 3.0.x, the filter
code treats the specifying of a protect rule inside a server-side rule file
as though the receiver-side option gets added to the server-side option,
turning it into a normal exclude (i.e. "P foo", aka "-r foo" turns into "-sr
foo").  In the 3.1.0dev code, your test case errors out with a rule conflict
(the specifying of a receiver-side rule inside a sender-side rule file).
 Specifying the "-r /x/***" rule on the command-line isn't considered a
conflict, since it never gets the implied 's' modifier added to it.

For the future, I'm thinking that it would probably be better to just allow
the specified-side rule to override an specified-side merge rule, which
would make the merge,s setting just a default to create sender-side rules
rather than it requiring all the rules therein to not specify a side.
 However, care needs to be taken to ensure that the side optimizations (and
per-dir merge files) are all handled correctly.

Your best bet for the meantime is to not mix --delete-excluded with
side-specifying filter rules, and just specify your hide rules directly --
i.e. replace --exclude-from=FILE with --filter=".s FILE" (though every
exclude line would need to have a "- " prefix) or --filter=".-s FILE"
(though every line would need to NOT have a +/- prefix), etc.

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20110913/f716b486/attachment.html>


More information about the rsync mailing list