Friday, March 26, 2010

A new backup script with rsync, versioning and rotation

Here is a backup script that does what every backup script should do:
  1. Use rsync or equivalent for transfer to speed things up
  2. Keep rotating versions of backups
  3. Don't duplicate files unless needed on the backup host (using hard links)
  4. Can be configured from a text file
One minor issue with this script, however, is that it runs from the backed up machine instead of the backup host (you don't want an intruder to gain access to your backup, ideally). But I made the script to use with EVBackup's service. While I trust them not to tamper with my encrypted data, I wouldn't trust them with the keys to PhilPapers's production server.

The script should run on any *nix machine with rsync. It should work with any *nix backup host as well, but you will need shell access to the backup host. You will also need to configure the user running the script for password-less login.