exclude-from and include-from confusion

Dave.Turner at VerizonWireless.com Dave.Turner at VerizonWireless.com
Thu Apr 22 15:43:46 GMT 2004


Thanks Wayne! That's doing the trick. I've been playing with combinations
and am now getting what I expect.

I think I'll be using something close to this for my exclude file to get
what I want.

+ /testdir/*
- /*/

Combining that with different modules will make it a much simpler task.

Thanks!

-----Original Message-----
From: Wayne Davison [mailto:wayned at samba.org]
Sent: Wednesday, April 21, 2004 5:21 PM
To: Dave.Turner at VerizonWireless.com
Cc: rsync at lists.samba.org
Subject: Re: exclude-from and include-from confusion


On Wed, Apr 21, 2004 at 04:51:57PM -0400, Dave.Turner at VerizonWireless.com
wrote:
> - Any directory or file listed in the exclude file will NOT be copied.
> - Any directory of file listed in the include file WILL be copied no
matter
> what is in the exclude file.

Only if the include comes before the exclude in the list of all includes
and excludes.  If you reverse the order of your --exclude-from and
--include-from options that would give the includes priority over the
excludes.  However, I'd recommend joining both files into a single file
using explicit "+ " and "- " prefixes and switching over to just one
--exclude-from=combo_file option.  E.g.:

+ /testdir/
+ /testdir/*
- *

(Note the explicit inclusion of the parent directory -- see the man
page's discssion of how patterns are applied recursively.)

Another solution that would work for the simple set of rules you listed
is this:

+ /testdir/
- /*

The two methods differ in how they treat subdirectories in "testdir",
though.

..wayne..


More information about the rsync mailing list