Using Rsync over SSH

Prerequisites

First make sure that you are able to login to the remote host using ssh key authentication.

Basic Syntax

To sync files from a local directory to a remote directory use the following syntax:

rsync {options} -e ssh {source} {dest}

Example

Here is an example that exclude all .psd and .fla files:

rsync –exclude *.psd \
[...]

SSH Login Using Public Key Authentication

Step 1: Generate Keypair on Localmachine

ssh-keygen -t dsa

When prompted for a passphrase you can leave it empty to enable logging in without a password (please note that there are potential security issues with doing this).

After confirming your passphrase at the second prompt you’ll find two new files (the keypair) in your ~/.ssh directory. The [...]