[ale] Copy server

Brian Pitts brian at polibyte.com
Fri Feb 18 10:37:34 EST 2011


On 02/18/2011 10:21 AM, Mark Heiges wrote:
> You also need a trailing slash on the SAM source directory to copy
> its contents to destination SAM, otherwise you'll end up with
> /opt/SAM/SAM:
> 
> rsync -avz --delete -e ssh root at master:/opt/SAM/ /opt/SAM
> 
> Or omit the slash and use the parent dir in the destination as in 
> Jerald's example.

It took me years to keep this straight in my head. From the manpage

"""
You can think of a trailing / on a source as meaning "copy the contents
of this directory" as  opposed  to  "copy  the  directory  by name", but
in both cases the attributes of the containing directory are transferred
to the containing  directory on the destination.  In other words, each
of the following commands copies the files in the same way, including
their setting of the attributes of /dest/foo:

              rsync -av /src/foo /dest
              rsync -av /src/foo/ /dest/foo
"""

-- 
All the best,
Brian Pitts


More information about the Ale mailing list