Need help with exclude

jw schultz jw at pegasys.ws
Wed Nov 26 09:30:49 EST 2003


On Tue, Nov 25, 2003 at 11:44:54AM -0600, daniel wrote:
> > 
> > On Tue, Nov 25, 2003 at 03:53:10AM -0600, daniel wrote:
> > > Thank you for clarifying the issue with regard to the fact that the
> > > exclude pattern is relative to the destination path.

You are welcome.

> > 
> > No, it's relative to the root of the transfer -- i.e. the names that the
> > two sides have in common.
> > 
> 
> First let me clarify the directory structure:
> 
> /foo
>     /test
>          /dir1
> 
> 
> But now I'm lost again.  What is the "root of the transfer" of this:
> 
> rsync -av /foo/test/ serv2:/foo/

On the destination it is /foo so on the source it is
/foo/test.

> My understanding was that the exclude is relative to the destination path, so:
> 
>  rsync -av --exclude=/foo/test/dir1/ /foo/test/ serv2:/foo/   
> 
> would actually exclude /foo/foo/test/dir1/  (non-existant)

Yes, but unless there is a /foo/test/test on the source the
rsync would not create a /foo/test on the destination.

Look at the output of rsync -v and you will see that paths
against which the patterns are compared.  Use the verbose
option twice (-vv) and you will see the exclude pattern
being applied as well.  It helps to redirect stdout to a
file.

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

		Remember Cernan and Schmitt



More information about the rsync mailing list