--exclude=/ seems not to work as I want

Cameron Simpson cs at zip.com.au
Wed Mar 11 05:13:11 GMT 2009


I know this may seem nonsensical, but I wanted to issue an rsync
invocation that synced nothing at all. (I wanted to avoid a sync by
fiddling a config file in some automation rather than changing to
auomation to have a skip-the-rsync mode.)

Anyway, it seems to me with rsync-3.0.5 that one of:

  --exclude=/
  --exclude=/*
  --exclude=*/

ought to omit the _entire_ directory tree. In fact, the first seems to do
nothing (the whole tree gets synced) and the latter two omit everything
except the top directory itself.

I had hoped to omit everything including the top directory, thus making no
changes of any kind to the target (yes, I know -n will do that too:-)

Any thoughts? I would have hoped the first (the no-op) would do,
and feel that maybe it should at least elicit an error message.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Out on the road, feeling the breeze, passing the cars.  - Bob Seger


More information about the rsync mailing list