Fwd: Delete some excluded files in rsync

Wayne Davison wayned at samba.org
Tue Mar 7 22:18:57 GMT 2006

Karel Kulhavy <clock at twibright.com> wrote:
> I suggest that a feature be added into rsync. That one could
> separately specify excluded files that should be deleted on the
> receiver and excluded files that shouldn't be deleted on the
> receiver.

That's already possible using filter rules.  An exclude both hides files
on the sending side, and protects files on the receiving side.  Each of
these actions may be specified separately using a filter option, like

    --filter='hide sender.file'
    --filter='protect receiver.file'
    --filter='exclude both-sides.file'

You can abbreviate "hide" as "H", "protect" as "P" and "exclude" as "-",
as you see fit.  Also, -f is short for --filter.

See also the "merge" (.) filter rule, which slurps a bunch of filter
rules from a file, as well as the "show" (S) and "risk" (R) rules, which
allow you to specify exceptions for your hide and protect rules.


More information about the rsync mailing list