I’m not leery of Google shuttering its Gmail service, but I can imagine a scenario where they cut off my access to Gmail and I have no way to plead my case to the search behemoth. So I went looking for a Gmail backup solution to put my mind at ease.
There are many options out there, but I ended up using BaGoMa with much success. Things that turned me on to BaGoMa:
- People were raving about it on a forum
- Python is already on all of my machines
- I can read Python pretty well and it looked well written
- Its flags are plentiful and documented
- It works with Google Apps for Domains
- It works with multiple accounts
- It respects Gmail’s labels
- It uses IMAP smartly
- It can run headless and be scheduled with cron
- It’s hosted on SourceForge, just kidding that was weird and scary
After installing BaGoMa on my backup server — a.k.a. The iMac in our bedroom — I wrote a little shell script to set the options and run the backup on all of our Gmail accounts:
#!/bin/sh echo "Backing up Jerod's email" /usr/bin/python /Users/santo/src/bagoma.py \ --file=off \ --firstname.lastname@example.org \ --pwd=ohnoididnt \ --dir=/Users/santo/Documents/Email/Jerod \ --action=backup echo "Backing up RSDi's email" /usr/bin/python /Users/santo/src/bagoma.py \ --file=off \ --email@example.com \ --pwd=againwiththepassword \ --dir=/Users/santo/Documents/Email/RSDi \ --action=backup # other accounts follow...
--file option disables logging to a file so all output is sent to STDOUT. The rest should be self-explanatory. After running the script manually a few times (the first run takes a LONG time if you have a lot of email), I set up a cron job to back up our email every night at 3AM.
crontab -e and added the following line:
0 3 * * * /Users/santo/bin/backup_email >>/var/log/backup_email.log 2>&1
BaGoMa’s output is pretty informative so I send it to log a file in case I ever want to check up on it and make sure the backups are still working.
That’s it. The thing has been running like clockwork ever since. If you’re similarily concerned about continued access to your email, I highly recommend BaGoMa.
But whatever you do, don’t follow me on Twitter. That would be absolutely ridiculous.