Yes. You can use the "
--filter merge /path/to/your_filter_file" option and put your list of
exclude and
include patterns in that file. Each line in the pattern file must begin with a prefix that indicates its function. See the section for "--filter=" and the "FILTER RULES" section in the
rsync manpage.
Here's a trivial example:
Code:
rsync -av --filter=$HOME/filter_rules Pictures/ /media/backup/Pictures
where there is a subdirectory "Pictures/private_pics", and the filter_rules file contains
Code:
include private_pics/Janes-face.jpg
exclude private_pics/*
Note that "-" is a synonym for "exclude" and "+" is a synonym for "include" in that filter file.
As with "--exclude" and "--include" options, the rules are processed in order, and an earlier rule overrides a later one. That is useful, for example, for including specific files that would also match a later
exclude pattern.