Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied.

Rsync is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination.

Syntax: rsync <option> <source> <destination>

Some helpful commands of rysnc

Syncing a local directory to a remote computer

~#rsync -avz /home/localdir [email protected]:/home/remotedir

Syncing remote folder to local computer

~#rsync -avz [email protected]:/home/remotedir /home/localdir

Syncing a directory on the same computer

~#rsync -avz /home/user1 /afolder/

Rsync over SSH

Rsync over SSH is a secure way to transfer file accross computers or from one location to another (using internet).  Personally I find it faster than scp.  Example below will allow you to copy a file from your computer to a remote location

~#rsync -avhe ssh -p <SSH PORT if not default> /home/localdir [email protected]:/home/remotedir

How to see data transfer progress with rsync.

Simply add –progress to the command above

~#rsync -avhe ssh –progress /home/localdir [email protected]:/home/remotedir

Its always a good idea to do a dry run before actually running your rsync command.

 

 

933  Linux, Unix  

Question ?

You will receive an email when your question will be answered.

+ = Verify Human or Spambot ?