I’m setting up a new linode360 VPS, based of the Ubuntu 8.04LTS image.
For backups, I want to do weekly backups and daily incrementals of the data files, and sync these off to an external backup location.
Broadly, there are two parts to the backup, creating the backed up files, and then copying them offsite.
Creating the backups
I’m using backup-manager 0.7.6-debian1, which handles backing up sets of files and MySQL databases to tar.gz files.
sudo aptitude install backup-manager
sudo /usr/sbin/backup-manager --version
The comments in the config file make editing it quite straight forward.
sudo vi /etc/backup-manager.conf
One minor points:
To test:
sudo /usr/sbin/backup-manager --verbose
The output folder you specified (/var/archives) should now contain some .tar.gz versions of your data. Hurrah!
Getting the files offsite
Originally I intended to use Amazon’s S3 as a backup store, following Michael Zehrer’s instructions on how to rsync with S3. However, I couldn’t get this to work reliably; so I opted instead for rsync.net which offers standard scp, ftp, WebDav and sshfs access to their geographic backup locations.
Backup-manager can rsync over ssh, which is a quick and efficient way to sync changes over to the remote host..
The first step is get your rsync.net account setup; and set up your ssh so you can access without typing in a password
Then, set the BM_UPLOAD_METHOD to rsync, and configure both the scp and the rsync settings in /etc/backup-manager.conf (pay attention not to prefix remote folders with / ).
Test with:
sudo /usr/sbin/backup-manager --verbose
Once its all working, set up a cron job to call backup-manager daily.
crontab -e
I run backup-manager once per day in the wee hours, and log output to /root/crontab/daily_backup-manager.logs
0 3 * * * /usr/sbin/backup-manager -v > /root/cronlogs/daily_backup-manager.log
Viola!