Backups!

There's some various things that I've wanted to have backed up in a reasonable fashion for awhile now. For awhile, I was just backing up stuff to a different machine, but I ran out of space, and ended up deleting my backups.

Earlier this week, I found that Amazon S3 has reasonable pricing for storage.

So, I'm using duplicity to back up stuff under Linux to the s3 cloud. I found some weird bugs in the version that ships with Ubuntu, so make sure you grab the latest version off their website.

Another thing that I wanted to back up was my GMail. I found these instructions cover the set-up rather nicely using a tool called getmail.

Here's some modifications I've made on those instructions for doing the backups:

  • Instead of using pop, I'm using IMAPS for this by changing the 'SimplePOP3SSLRetriever' line in the config to 'SimpleIMAPSSLRetriever'.
  • Add the following to the configuration:

    mailboxes = ("[Gmail]/All Mail", "[Gmail]/Sent Mail")

    This will archive all my mail. You could also define all your mailboxes manually, but I'd rather just have it all backed up. If you need help with the names, you'll need to use a normal IMAP client to view everything.
  • Running 'chmod 600' on the config file you create so nobody else on your system can read it (even if it's a single user system - if you give access to anyone they won't be able to see your passwords).

Finally, create a simple script like the following to do the backups of everything. I'm backing up everything in my ~/backups dir, so it's an easy place for me to drop things to back up.

getmail -ln --rcfile getmailrc.someusername
/usr/bin/mysqldump -u mythtv mythconverg > ~/backups/db/mythconverg.sql
duplicity full --volsize 100 -v5 ~/backups/ s3+http://somebucket/sometag

It seems to be working pretty well, and gives me some decent backups of things!