include-exclude patterns

Wayne Davison wayned at
Tue Dec 10 19:07:01 EST 2002

On Tue, Dec 10, 2002 at 09:18:06AM -0500, marco wrote:
> I even tried this but it include the whole /var/ folder !
> I just want /var/lib/zope.

The solution is that after you include something that is too general,
you need to exclude what you don't want.  Like this:

- /*
- /var/*
- /var/lib/*

Explanation:  The inclusion of /var is needed just to get rsync to
descend into that directory.  At that point, you need to add rules for
what to do inside of /var, which is to just descend into lib and exclude
everything else.  The final two rules tell rsync what to do once inside
of /var/lib (include zope, exclude everything else).  At that point
everything in the zope hierarchy will be included.


More information about the rsync mailing list