https://bugzilla.samba.org/show_bug.cgi?id=14371

            Bug ID: 14371
           Summary: Combined Exclude & Protect Filter Type
           Product: rsync
           Version: 3.2.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: core
          Assignee: wa...@opencoder.net
          Reporter: sa...@haravikk.com
        QA Contact: rsync...@samba.org

This proposal is for a new filter rule that combines an exclude and a protect
rule into a single line.


REASONING

When using rsync to perform backups, it can be possible to optimise performance
by identifying in advance on the sending side any directories that haven't
changed. For example, when rsync'ing from a macOS Time Machine backup, if you
can compare against a previous backup you've already rsync'd across then it's a
simple case of checking directory inodes, any directory whose inode matches the
same directory in the previous backup is completely unchanged, and so can be
skipped completely by rsync (no need to check it or its contents).

To do this, I generate a filter list with lines that look like the following:

- /path/to/unchanged/directory/
P /path/to/unchanged/directory/
- /path/to/another/unchanged/directory/
P /path/to/another/unchanged/directory/

This tells rsync to exclude the unchanged directories, but to not exclude them
(when --delete-excluded is present, as it should be when taking backup
snapshots).

Now this works great, the "problem" is that it requires two lines per entry to
do what is a very useful trick, so what I would like to see is the addition of
a combined option to do this. For example S for skip, so that I can do in a
single line what I'm currently doing in two (resulting in a filter list that's
twice the size it needs to be).

Alternatively, this could be added as an option for either the exclude or
protect rule. So the possible syntaxes would be:

S /foo/bar/baz                Skip /foo/bar/baz
-,P /foo/bar/baz              Exclude /foo/bar/baz and protect from deletion
P,S /foo/bar/baz              Protect /foo/bar/baz from deletion and skip
checking it

I prefer the first as it feels enough like a distinct operation to potentially
warrant its own rule, but I'd be fine with either of the others. -,P is perhaps
the most logical (allows the P rule as part of an exclude rule)?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to