Using Rsync as a Backup Solution

As we have repeatedly told you and even warned you on this site, backing up your server is of the utmost importance. Back up every important piece of data you have, and if you really want to be safe, make backups of your backups. One useful backup solution is Rsync. We have already explained how to use rsync, but it might also be useful to examine some of the intricacies of using it as a backup solution.

Automated Backups – You can always throw an rsync backup script into cron.daily, cron.weekly, or cron.monthly, but if your backup device is at another physical location (which it should be), you will need to provide the SSH password every time rsync wants to connect. That is impossible with cron, out of the box.

One solution is to setup password-less login with an SSH key. This will encrypt the sign in, but it does mean that a third party that gains access to your server can also easily get access to your backup server. A fix for that is to limit the SSH key to a single command (in this case rsync). That way, the worst a hacker can do is backup your files for you.

Incremental Backups – By definition, rsync is an incremental copying solution. This means that files that have already been copied will not be recopied. Some server administrators, however, expect incremental backups to also provide snapshots of backups, creating separate backup files for each backup instance. For something like this, you might consider using irsync for point-in-time incremental backups.