Using rsync Instead of scp

2016-05-26 14:18

I have used rsync many times in the past, but until recently I used scp in my daily toolkit for copying files from one host to another. About eight months ago, I was moving some big files, and started an scp job that later failed - and I immediately regretted not selecting rsync for the job. Since that day, I have been using rsync for all my inter-host copy jobs.

Rsync is a powerful tool that is much better described over here, but for my purposes I use a small subset of it’s capabilities.

rsync -avzhe ssh ~/path/to/file user@host:/path/to/destination

Let me brak down for you what this does – from the man page

-a, --archive archive mode; same as -rlptgoD (no -H)

-v, --verbose increase verbosity

-z, --compress compress file data during the transfer

-h, --human-readable output numbers in a human-readable format

-e, --rsh=COMMAND specify the remote shell to use

If the file is large I will also include --progress and --partial

UPDATE - 2016-10-02: providing the link to everythinglinux.org