--exclude patterns

Randy Dunlap rdunlap at xenotime.net
Sat Jan 26 02:02:07 GMT 2008


I want to rsync a large number of files from A to B, but I need
to exclude certain files.  Specifically, A has
/test/runs/{1,2,3,...,2500}, i.e., about 2500 directories here.
However, I only want to transfer the directories that are
numbered 2000 or higher, i.e., I want to exclude
/test/runs/{1,2,3,...,1999}, so I tried this:

rsync --include='/test/runs/***' \
--exclude='--exclude=/test/runs/? --exclude=/test/runs/?? --exclude=/test/runs/??? --exclude=/test/runs/1???' \
-avz -e ssh --progress --delete $srcdir $dest:$destdir/

Should this work?  If so, maybe I just have some quoting problems...
If not, how do I need to modify the include/exclude patterns?


More information about the rsync mailing list