Yet another include/exclude question

Thomas Gutzler thomas.gutzler at
Sun Nov 8 23:21:03 MST 2009

What if I also want to include everything in /this_dir/ without running
two instances and still being able to use --delete?
I thought --include="/this_dir/" --include="/this_dir/***" would do it,
but it doesn't. The exclude * seems to overwrite the include matches:
 [sender] hiding file this_dir/foo because of pattern *


Steven Monai wrote:
> Tony wrote:
>> On Nov 6, 2009, at 12:43 AM, Thomas Gutzler wrote:
>>> Hi,
>>> How can I include only *.foo and *.bar files in an rsync?
>>> To make it a bit more difficult: Those files can be anywhere in the
>>> directory structure.
>>> I've been reading and trying for a while but the best I got is all
>>> *.foo and *.bar files in ./ but none of the ones inside any
>>> directories.
>> There is an example in the man pages for *.c files that will do what you
>> want.
>> Try:      --include=*/ --include=*.foo --exclude=*
> Yes. I would also strongly recommend the section of the man page that
> describes "--prune-empty-dirs".
> Cheers,
> -SM
> --

More information about the rsync mailing list