Rsync: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
You must first allow root ssh on destination server and set root password (only temporarily!).
You must first allow root ssh on destination server and set root password (only temporarily!).


To copy a directory from one host to an existing directory on another host (via SSH):
To copy a directory from one host to an '''existing''' directory on another host (via SSH):
<pre>
<pre>
rsync -a -e ssh /export/nfs/swn/ coil:/export/tarballs/swn_test/
rsync -a -e ssh /export/nfs/swn/ coil:/export/tarballs/swn_test/
</pre>
</pre>
 
If the target directory does not exist on the destination:
<pre>
rsync -a -e ssh /export/nfs/swn coil:/export/tarballs/
</pre>
* A trailing slash in the source field means 'copy the contents of this folder'.
* A trailing slash in the source field means 'copy the contents of this folder'.
* No trailing slash in the source field means 'copy this entire file or folder'.
* No trailing slash in the source field means 'copy this entire file or folder'.
* A trailing slash in the destination field means 'copy contents to this folder'.
* A trailing slash in the destination field means 'copy contents to this folder'.
* No trailing slash in the destination field means 'copy entire file or folder to this file or folder name'.
* No trailing slash in the destination field means 'copy entire file or folder to this file or folder name'.

Latest revision as of 18:10, 6 February 2012

You must first allow root ssh on destination server and set root password (only temporarily!).

To copy a directory from one host to an existing directory on another host (via SSH):

rsync -a -e ssh /export/nfs/swn/ coil:/export/tarballs/swn_test/

If the target directory does not exist on the destination:

rsync -a -e ssh /export/nfs/swn coil:/export/tarballs/
  • A trailing slash in the source field means 'copy the contents of this folder'.
  • No trailing slash in the source field means 'copy this entire file or folder'.
  • A trailing slash in the destination field means 'copy contents to this folder'.
  • No trailing slash in the destination field means 'copy entire file or folder to this file or folder name'.