Help using --exclude

jw schultz jw at pegasys.ws
Tue Jul 29 07:17:06 EST 2003


On Mon, Jul 28, 2003 at 01:31:41PM -0700, Wayne Davison wrote:
> On Mon, Jul 28, 2003 at 01:21:38PM -0700, Scott Sewall wrote:
> > My hope was the exclude pattern .mozilla/**/Cache/ would prevent the
> > Cache directory and all files within it from being copied.
> 
> This fails in the released versions of rsync due to a bug in the exclude
> code (though the CVS version has this fixed already).  You can work
> around this bug in a number of ways, for instance, using this:
> 
>     --exclude=/*/.mozilla/**/Cache/

Wayne, if i recall correctly this pattern will break if an
upgrade includes a change to your wildmatch code.  The
transition to being something i'm favoring.  Besides, it is
better, as a matter of self-documentation, to be explicit
about when you want a to match multiple directory levels.

     --exclude=/**/.mozilla/**/Cache/

Is explicit and is safe from future pattern matching code changes.

> 
> or this:
> 
>     --exclude=Cache/
> 
> This latter version would also exclude a "Cache" dir outsize of the
> .mozilla dir, which might not be acceptable to you.

Yes.  I have one setup where i'm using
        cache/
	Cache/
	.kde/share/thumbnails/
	trader-cache/
but no one on those systems would create a directory named
cache.  I think i'll change it to
	/**/.*/**/cache
so the matching of a directory named cache will only happen
if it is somewhere under a dotted directory.


-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt



More information about the rsync mailing list