resolving difference in interface between rsync and cp/rcp/scp

Wesley W. Terpstra wesley at terpstra.ca
Wed Nov 1 13:06:59 GMT 2006


On Nov 1, 2006, at 6:19 AM, Erick Tryzelaar wrote:
> No one has any ideas?

This difference you've noted is documented in man rsync (1):
>        A trailing slash on the source changes this behavior to  
> avoid  creating
>        an  additional  directory level at the destination.  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  contain-
>        ing  directory on the destination.  In other words, each of  
> the follow-
>        ing commands copies the files in the same way, including  
> their  setting
>        of the attributes of /dest/foo:

>> > mkdir tmpdir; cd tmpdir
>> > mkdir a; touch a/b
>> > rsync -r a b/
>> > ls b
>> a/

Try: "rsync -r a/ b/" instead.



More information about the rsync mailing list