exclude vs include

Phil Howard phil-rsync at ipal.net
Sun May 19 08:43:01 EST 2002

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/ \

| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| phil-nospam at ipal.net | Texas, USA | http://phil.ipal.org/     |

More information about the rsync mailing list