Using rsync

From vpsget wiki
Revision as of 21:48, 1 October 2015 by Ndi (talk | contribs)
Jump to: navigation, search

If you need to copy some data from one vsp to another you can use scp. But if you would like to sync data you can use more powerful tool called rsync. The detailed differ of rsync and scp you can find in the internet.

We will share the example of the usage: Semantic:

rsync -avzH --numeric-ids -e 'ssh -p<ssh_port>' /local/path/somefile.tar.gz <destination_IP>:/remote/path/somefile.tar.gz

Example:

rsync -avzH --numeric-ids -e 'ssh -p6622' /vz/template/cache/centos-6-x86.tar.gz 192.168.1.2:/vz/template/cache/centos-6-x86.tar.gz


Example2 .

This command can be used to synchronize a folder, and also resume copying when it's aborted half way. The command to copy one disk is:

rsync -avxHAX --progress /mnt/some_disk /usr/bcp/

Command options clarification:

-a  : all files, with permissions, etc..
-v  : verbose, mention files
-x  : stay on one file system
-H  : preserve hard links (not included with -a)
-A  : preserve ACLs/permissions (not included with -a)
-X  : preserve extended attributes (not included with -a)