Difference between revisions of "rsync"

From thelinuxwiki
Jump to: navigation, search
(Created page with " using ssh # rsync -avz '''-e ssh''' remoteuser@remotehost:/remote/dir /this/dir/ category:backup")
 
Line 3: Line 3:
 
  # rsync -avz '''-e ssh''' remoteuser@remotehost:/remote/dir /this/dir/
 
  # rsync -avz '''-e ssh''' remoteuser@remotehost:/remote/dir /this/dir/
  
 +
effect of trailing slash...
 +
#1: rsync -a --delete /some/path/a/ /some/otherpath/
 +
 +
#2: rsync -a --delete /some/path/a /some/otherpath/
 +
 +
Answer: the first will make /some/otherpath mirror the contents of /some/path/a, while the latter will create a directory in /some/otherpath/a whose contents will mirror /some/path/a.
 
[[category:backup]]
 
[[category:backup]]

Revision as of 14:07, 28 March 2014

using ssh

# rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/

effect of trailing slash...

#1: rsync -a --delete /some/path/a/ /some/otherpath/
#2: rsync -a --delete /some/path/a /some/otherpath/
Answer: the first will make /some/otherpath mirror the contents of /some/path/a, while the latter will create a directory in /some/otherpath/a whose contents will mirror /some/path/a.