Rsync over SSH
How to use rsync to copy files over an SSH encrypted connection.
Rsync is a utility that will copy files from one machine to another. In addition, rsync will determine if it needs to copy the entire file, or just changes, making rsync very fast on subsequent transfers.
This recipe was assembled from using Cygwin’s rsync package on a Microsoft Windows XP machine. Your syntax may be slightly different on other platforms.
The command:
rsync -avz -e ssh
will copy the “
Slightly modified, the command:
ssh user@firsthost rsync -avz -e ssh
will establish an ssh connection to “firsthost”, then launch rsync over SSH to “secondhost”, copying “
When combined with SSH public key authentication, it is possible to automate (cron) backups over the SSH secure connection without a password.
NOTE: The parameters mean:
- a = archive
v = verbose
z = compress file data
e = specifies remote shell to use





