[Linux-disciples] Rsync includes and excludes

Adam Rosi-Kessel adam at rosi-kessel.org
Tue Sep 27 11:13:47 EDT 2005


Stephen R Laniel wrote:
> Rsync includes and excludes have always confused me, for
> some reason; maybe it's because I don't write rsync command
> lines very often. In any case, here's what I want to do:
> include only the directory ~/private/consulting gigs, and
> exclude everything else. I thought that
> rsync -r --exclude '**' --include ~/private/consulting_gigs / remoteUser at domain.com

Why can't you just do:

  rsync -r ~/private/consulting_gigs remoteUser at domain.com:

??

Have you read the INCLUDE/EXCLUDE PATTERN RULES part of the rsync manpage?

I think the way it works is that it stops at the first rule which matches;
in your example above, the exclude rule matches first, so that's all she wrote.

I think it's generally easier and more elegant to use a pattern file,
though, rather than try to get the rules on the command line.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050927/bb42695b/signature.pgp


More information about the Linux-disciples mailing list