How to change permissions on a directory without meaning to... - include/exclude semantics

Wayne Davison wayned at samba.org
Wed Oct 8 03:21:16 EST 2003


On Tue, Oct 07, 2003 at 09:55:45AM -0700, jw schultz wrote:
> This should probably be attached to this paragraph early in the USAGE
> section:

I've incorporated some suggested tweaks into the text you cited.
See if you like this:

a trailing slash on the source changes this behavior to transfer all
files from the directory src/bar on the machine foo into the /data/tmp/.
A trailing / on a source name means "copy the contents of this
directory, em(including) the '.' file".  Without a trailing slash it means
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"copy the directory by name". This difference becomes particularly
                   ^^^^^^^^
important when using the --delete option.

Note that the inclusion of the '.' file in the copy when using a
trailing slash causes the destination directory to be affected if
file attributes (ownership, mode, etc.) are being copied.  It is
impossible to exclude the dot file to prevent this, so don't do
something like this:

quote(rsync -av /some/dir/ /tmp/)

Unless you want the attributes of /tmp to change.

..wayne..



More information about the rsync mailing list