rsync to transfer files

      Comments Off on rsync to transfer files

A good way to transfer files between machines via the network would be to use rsync.

Simply issue the command :

rsync -avzPh /source/folder/ user@server.url:/destination/folder/

rsync is usually much faster than another linux command scp (secure copy) because the latter basically reads the source file and writes it to the destination. It performs a plain linear copy, locally, or over a network.
Before a file is transferred rsync takes the checksums of the file (MD5 and adler-32 I believe) and sends them to the receiver. After a file is transferred the receiver verifies the data integrity using those checksums. scp does not have such mechanism.
rsync also copies files locally or over a network. But it employs a special delta transfer algorithm and a few optimizations to make the operation a lot faster.
In addition,rsync supports numerous command line options, allowing the user to fine tune its behaviour. It supports complex filter rules, runs in batch mode, daemon mode, etc. In contrast, scp has only a few switches.

rsync allows the files to be compressed before transfer, thereby speeding up file transfer, and decompressing them on the fly

While scp will ignore any partially transferred set of files and overwrite them on the receiving end, rsync is more clever than that. rsync will check the destination for any files present and if their signature matches that of the files on the sender side it will not retransmit these files.