Difference between revisions of "rsync"

From thelinuxwiki
Jump to: navigation, search
 
Line 8: Line 8:
 
  #2: 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.
+
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]]

Latest revision as of 15:39, 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/

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.