Bug#305932: rsync on a directory transfers the files of this directory

Paul Slootman paul at debian.org
Fri May 20 09:08:15 GMT 2005


On Thu 19 May 2005, Wayne Davison wrote:

> On Thu, May 19, 2005 at 11:04:23AM +0200, Paul Slootman wrote:
> > --files-from transferring the contents of a dir (i.e. including the
> > files in it) specified in the input, even though the files aren't
> > listed in the input.

> That's as intended, since a trailing slash means "the contents of the
> directory".  This is not unique to --files-from, but also happens when
> -d is specified and a directory on the command-line has a trailing slash
> (obviously -r must not be specified, or even deeper files would also be
> copied, not just the directory's immediate contents).  The behavior was
> first introduced in 2.6.4 when --dirs (-d) was added.  The man page

Ah... The example given states:

    If /tmp/foo contains the string "bin" (or even "/bin"), the /usr/bin
    directory will be created as /backup/bin on the remote host (but the
    contents of the /usr/bin dir would not be sent unless you specified
    -r or the names were explicitly listed in /tmp/foo).

I'd suggest changing the last line to:

    -r or the names were explicitly listed in /tmp/foo; or the "bin" has
    a trailing slash added so that the implied --dirs option causes the
    immediate contents of that directory to also be transferred).

These implied options, while being terribly useful, are a disaster
when trying to understand what a particular option does. Hence I think
it can't hurt to sometimes be a bit more explicit, especially in the
examples.


thanks,
Paul Slootman


More information about the rsync mailing list