Need help with exclude

Francis Montagnac Francis.Montagnac at sophia.inria.fr
Tue Nov 25 18:15:19 EST 2003


Hi,
...
> rsync -av --exclude=/foo/test/dir1/ /foo/test serv2:/foo
> and the exclude still does not work.

The following works:

  rsync -av --exclude=/test/dir1/ /foo/test serv2:/foo

Why?

Because one should think the exclude pathnames are *relative* ones to
the destination directory.

In your case, you want the /foo/test directory to be copied as
serv2:/foo/test.

Note that this is equivalent to:

  rsync -av --exclude=/dir1/ /foo/test/ serv2:/foo/test

I admit that this is not quite obvious.

-- 
Francis.Montagnac at sophia.inria.fr, Tel: (33) 04 92 38 79 11, Bur: C112
INRIA Sophia, 2004, rte des Lucioles, B.P.93 - 06902 Sophia Antipolis Cedex



More information about the rsync mailing list