Include on few directory

Matt McCutchen hashproduct+rsync at gmail.com
Thu Oct 4 12:51:25 GMT 2007


On 10/4/07, OOzy Pal <oozypal at gmail.com> wrote:
> excludes-nix
> *
>
> include-nix
> Development/*
> www/*
> Personal/*

You are including items immediately inside each of the directories
Development, www, Personal but not the directories themselves, also,
the exclude rule * is excluding items more than one level under those
directories.  Use the triple star on your directory patterns to make
them match the directory and anything directly or indirectly inside.
Also, since you are referring to specific directories at the top level
of the source, it would be more correct to anchor the include patterns
(although it won't make a difference in this case):

/Development/***
/www/***
/Personal/***

A better way to copy just a few directories might be to use
--files-from or even just list them as separate source arguments with
--relative:

sudo rsync -avrtzun --stats --delete --progress -e "ssh -l hab"\
--relative /home/hab/./{Development,www,Personal} desktop:/home/hab

(The braces are expanded by the shell.)

Matt


More information about the rsync mailing list