exclude vs include

Dave Dykstra dwd at bell-labs.com
Mon May 27 05:22:03 EST 2002


Yes, rsync applies the patterns in order.

You need to include both the people subdirectories and all the files under
them.  Either
        '--include' '/people/andrea/' \
        '--include' '/people/andrea/**' \
or
        '--include' '/people/andrea**' \
should work.

- Dave Dykstra


On Sun, May 19, 2002 at 10:39:47AM -0500, Phil Howard wrote:
> My understanding of the man page description of --exclude vs. --include
> is that the list of these is kept in order, and file names are searched
> against these parameters in that order for the first that matches and
> that one makes the decision.  It doesn't seem to be working exactly as
> expected.  But there is a factor involved that's making it unclear,
> which is whether or not *'s should be appended or not.
> 
> In the following I am trying to have only selected subdirectories from
> the "people" directory included, and all other subdirectories from there
> not included.  The problem is, I either get _all_ the "people" trees,
> or none.  I've tried all the possible ways to append to each name, trying
> nothing, "/", "/*", and "/**".  Also, I've tried putting the exclude for
> "people" both before and after (I thought the after position should work)
> the includes for the 4 subdirectories.
> 
> Anyone know what I'm doing wrong here?
> 
> This is how it gets run from the script (the -n is so I can test it
> without actully pulling down files).  In this case I have appended
> the "/**" to each include/exclude name.  Is it obvious to you want I
> want to do and am I expressing it correctly?
> 
> rsync   '-anv' \
>         '-B65536' \
>         '--partial' \
>         '--stats' \
>         '--exclude' '*.gz.sign' \
>         '--exclude' '*.gz' \
>         '--exclude' '/Historic/**' \
>         '--exclude' '/SillySounds/**' \
>         '--exclude' '/crypto/**' \
>         '--include' '/people/andrea/**' \
>         '--include' '/people/marcelo/**' \
>         '--include' '/people/rgooch/**' \
>         '--include' '/people/riel/**' \
>         '--exclude' '/people/**' \
>         '--exclude' '/ports/**' \
>         '--exclude' '/projects/**' \
>         '--exclude' '/testing/**' \
>         '--exclude' '/uemacs/**' \
>         '--exclude' '/v1.0/**' \
>         '--exclude' '/v1.1/**' \
>         '--exclude' '/v1.2/**' \
>         '--exclude' '/v1.3/**' \
>         '--exclude' '/v2.0/**' \
>         '--exclude' '/v2.1/**' \
>         '--exclude' '/v2.2/**' \
>         '--exclude' '/v2.3/**' \
>         rsync.kernel.org::pub/linux/kernel/ \
>         /home/rsync/mirrors/linux-kernel/rsync.kernel.org/pub/linux/kernel/
> 
> -- 
> -----------------------------------------------------------------
> | Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
> | phil-nospam at ipal.net | Texas, USA | http://phil.ipal.org/     |
> -----------------------------------------------------------------
> 
> -- 
> To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html




More information about the rsync mailing list