exclude confusion: what does it match against?

Wayne Davison wayned at samba.org
Wed Mar 31 15:55:01 GMT 2004


On Tue, Mar 30, 2004 at 09:33:26AM +0200, Francis Montagnac wrote:
> On Fri, Mar 26, 2004 at 08:55:48PM -0600, John Van Essen wrote:
> > Example cmd: rsync -a --relative /home/me /dest
> > Source root: /home
> 
> I think it's instead:
> 
> Source root: /
> 
> Am i wrong?

I think you're right.  Elsewhere in the man page we're telling people
that excludes are relative to the root of the transfer, so your
correction is necessary to make that true.

I wonder if we should change the examples to have multiple sources?
Perhaps this would be good:

Let's say that we want to match two source files, one with an absolute
path of "/home/me/foo/bar", and one with a path of "/home/you/bar/baz".
Here is how the various command choices differ for a 2-source transfer:

   Example cmd: rsync -a /home/me /home/you /dest
   Source root: /home       (me & you are part of transfer)
   +/- pattern: /me/foo/bar
   +/- pattern: /you/bar/baz
   Target file: /dest/me/foo/bar
   Target file: /dest/you/bar/baz

   Example cmd: rsync -a /home/me/ /home/you/ /dest
   Source root: /home/me               (due to trailing /)
   Source root: /home/you              (ditto)
   +/- pattern: /foo/bar               (note missing "me")
   +/- pattern: /bar/baz               (note missing "you")
   Target file: /dest/foo/bar
   Target file: /dest/bar/baz

   Example cmd: rsync -a --relative /home/me/ /home/you /dest
   Source root: /
   +/- pattern: /home/me/foo/bar       (note full path)
   +/- pattern: /home/you/bar/baz      (ditto)
   Target file: /dest/home/me/foo/bar
   Target file: /dest/home/you/bar/baz

   Example cmd: cd /home; rsync -a --relative me/foo you/ /dest
   Source root: /home
   +/- pattern: /me/foo/bar      (starts at specified path)
   +/- pattern: /you/bar/baz     (ditto)
   Target file: /dest/me/foo/bar
   Target file: /dest/you/bar/baz

..wayne..


More information about the rsync mailing list