On Nov 1, 2006, at 6:00 AM, woo robbin wrote:
For example,if there is ten subdirectories named sub1~sub10(each including subdirectories and files too),and file1~file10,how can I rsync only sub2 and sub 3 to the target?

rsync -av --delete --include "/sub2/" --include "/sub3/" / MyFolder/ /dest/
this seems to sync other directories and files too.

The reason that doesn't work is because include only cancels out an exclude. Since you've not excluded anything, the include does nothing. You could add an --exclude '/*' if you wanted to do this with include/excludes: rsync -av --delete --include "/sub2/" --include "/sub3/"--exclude '/ *' /MyFolder/ /dest/

However,
        rsync -av --delete /MyFolder/sub2 /MyFolder/sub3 /dest
is probably the simplest (and therefore best) solution.


--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to