How to exclude directories from source with --relative

Wayne Davison wayned at
Sat May 31 17:40:47 GMT 2008

On Sat, May 31, 2008 at 10:20:35AM -0700, Stuart Anderson wrote:
> I would like to be able to use shell globing to generate a long list
> of source directories but still allow rsync to filter out some of those.

That is supported, but you must exclude an item you've specified, not an
implied component of an item you've specified.  So, if you change the
"--exclude=abc/" to "--exclude=abc/**", anything inside that dir will
not get transferred.

The thing that I should fix is when an "--exclude=abc/***" removes all
the args that implied the abc dir -- then that directory should indeed
not have been included in the transfer in the first place.


More information about the rsync mailing list