--relative, --dirs and --delete without --recursive

Matt McCutchen matt at mattmccutchen.net
Wed May 20 02:42:34 GMT 2009


On Tue, 2009-05-19 at 16:16 -0300, Carlos Carvalho wrote: 
> The manual says that without --recursive directories are (noisily)
> skiped. However with --relative intermediate directories are created.
> So what happens if you give only -R? Is -d the default? And what
> happens when you give -R --no-dirs? I tried and it seems that
> intermediate dirs are considered anyway, so it looks like -R overrides
> --no-dirs. Is it true? Does it depend on the order of options?

With -R, the "intermediate" dirs (standard term is implied dirs) are a
special case.  All other directories are governed by -d/-r.

> On a related matter, I'm not clear on the behavior of --delete with -d
> but without -r. The manual says "deletions will also occur when --dirs
> (-d) is enabled, but only for directories whose contents are being
> copied." However without -r the contents are not copied, only the
> directories themselves, right?

That is the case for source directories specified without a trailing
slash.  If a directory is specified with a trailing slash, rsync copies
its immediate contents (including immediate subdirectories but not
anything inside them) and deletes extraneous files from the
corresponding directory in the destination.

-- 
Matt



More information about the rsync mailing list