Securely Sending Your Repository to the Cloud

backup-manager is a great utility that supports delivery to Amazon S3.With this tool, it is possible to schedule jobs that do full or incremental backups and push them off to the cloud, even encrypted before they cross the wire. It reminds me a lot of duplicity, tarsnap, and desktop clients like JungleDisk, but is very easy to use and has little dependency on third parties.

Unfortunately, it does not work out-of-box, so to speak. First, set up AWS: Create a bucket in S3 dedicated for backup-manager.

Next, use apt to install backup-manager. It will run through some configurations, like what you'd like to backup (e.g. /etc, /home/git). Once it's installed, you can be stop here and begin backing up to local drive... Or, you can create the most resilient offsite backup ever. Install dependencies for connecting to S3. I'm using it to backup my git remote repositories on an Ubuntu server.

sudo apt-get install libperl6-slurp-perl libxml2-dev
sudo cpan XML::LibXML
sudo cpan Net::Amazon::S3

Once these are installed, all you need to do is follow the very detailed instructions in /etc/backup-manager.conf: Find the line export BM_UPLOAD_METHOD= and add "s3", add your AWS bucket access key and secret key, and if you are paranoid (like most offsite backup administrators are), set:

export BM_ENCRYPTION_METHOD="gpg"

and specify a key ID to encrypt to in BM_ENCRYPTION_RECIPIENT.

Try a test run, and make sure it saves the tarball where you specified and encrypted it. Set your cron for your favorite backup interval (I do daily backups), and voila! Secure redundant offsite backups that only a rogue asteroid or global thermonuclear war could take out.

Share |

Posted on September 14, 2010 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it



Comments:

Post a Comment:
  • HTML Syntax: Allowed