--exclude patterns

Jon me at jonwatson.ca
Sat Jan 26 17:46:30 GMT 2008


Just blowing through my email quickly, but have a thought.

I use include and exclude files rather than specifying them on the command
line. Using files, I would think that including /test/runs/2??? would work
and preclude the need for any excludes. I would think the same thing would
work on the command line and instead of including /test/runs/*** as you've
done (although I don't understand the three *'s), including /test/runs/2???
would work.

I've never used the single character ? wildcard before, though. I assume
rsync will understand it.

I believe rsync can take regular expressions as include and excludes as well
so you have a great deal of flexibility there.

On Jan 25, 2008 10:02 PM, Randy Dunlap <rdunlap at xenotime.net> wrote:

> Hi,
>
> 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?
>
> TIA.
> ---
> ~Randy
> --
> To unsubscribe or change options:
> https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html<http://www.catb.org/%7Eesr/faqs/smart-questions.html>
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list