rsync usage

rsync backup over ssh

Using rsync is a really simple way of creating automatic backups of important data.

I try to keep all important information under the /home/ folder. To backup the contents of this folder to an external machine over ssh I use the following script. Here it is assumed that a ssh login account for user backup has been created with no passphrase (see e.g. WebserverInstallation).

rsync -ae ssh /home/ backup@library:/home/backup/
logger "/home folder synced to backup@"

On my backup server I also do backups. On this server I dont want to backup the complete music library, which is excluded in the following script.

/usr/local/bin/rsync --exclude='/home/share/music' -a --del --force /home /backup
logger "rsync /home (with exceptions) to /backup"

A call to these scripts are then added to /etc/weekly or /etc/daily to make synchronization automatic.

Incremental backup using rsync

Now I have switched to a fully incremental backup of each client.

Incremental rsync backup