Include Exclude .. a canonical way

Harry Putnam reader at newsguy.com
Sat Feb 25 16:27:58 GMT 2006


Matt McCutchen <hashproduct at verizon.net> writes:

> On Wed, 2006-02-22 at 11:24 -0800, Wayne Davison wrote:
>>     rsync -avO --prune-empty-dirs --include=bookmarks.xml 
>> 	      --filter='-! */' ~/.kde* some:dest/
>
> I just discovered a way to transfer certain files and folders a few
> levels below a generic exclude rule without having to include everything
> on the way; in hindsight it seems so obvious that I'm really surprised
> no one has discovered it yet.  End your exclude rules in * instead of
> **, use --relative, and just list all the things you want included!  The
> source arguments "sneak under" the generic exclude rule.  Example:
> 	rsync --exclude=/.kde* --relative ~/./ \
>             ~/./.kde3.5/share/apps/konqueror/bookmarks.xml dest/

Nice, but what else might the --relative inclusion do? I remember some
time in the past having that set in rsnaphshot config and ending up
with a really confusing directory structure under the backup dest.

(May have had something like --copy-unsafe-links in there too)

Maybe if I leave out any `link' rules (which I currently do) it will
have no effect other than the one you describe?



More information about the rsync mailing list