Tuesday, February 17, 2009

Simple incremental backups using Amazon S3 and Brackup

I've been using the opensource Brackup tool to backup some of my documents and photos to the cloud (Amazon S3 - which charges as little as $0.150 per GB per month). 

This should work on many platforms:

Install Brackup (implemented in Perl) using CPAN:
$ sudo perl -MCPAN -e shell
once inside the CPAN shell:
cpan> install Net::Amazon::S3
cpan> install Brackup

Now configure Brackup (".brackup.conf" on your home directory) by defining some file sources and an S3 account target:
type = Amazon
aws_access_key_id = 1xxxxxNxxxxxFxx9xWx2
aws_secret_access_key = xxxxxxxYxRAoxuxDxrxxxxxxfxx4xxxxxxxxxdxx
keep_backups = 10

path = /Users/ricardocabral/Documents
ignore = ^/books/
ignore = ^/Parallels/
ignore = ^eclipse
ignore = ^hdd
ignore = ^.svn

path = /Users/ricardocabral/Pictures
ignore = ^iPhoto
ignore = ^.svn
The commands I have on a cron job are:
brackup --from=documents --to=s3_pers -v
brackup --from=pictures --to=s3_pers -v
To restore a backup after a disaster, one can get all remote files describing "backup snapshots" with:
brackup-target s3_pers get_backups
Then choose the backup snapshot descriptor file corresponding to the point in time you want to restore and do:
brackup-restore --from=documents-1214139675.brackup --to=/target/dir --all

No comments: