This weekend I have been experimenting with Gmvault ( in order to back up my various Gmail and Google Apps accounts to my computer. I’m using Mac OS X, but almost all of this will work with Linux too.

Firstly I downloaded the software, extracted it, and ran the following command once to download all of the mail in each account:

./gmvault synch

I then wrote a script to automate the process:

#change to the correct directory
cd /Applications/gmvault/bin/
#run a quick sync on all my gmail and google apps accounts
./gmvault sync -m -t quick
./gmvault sync -m -t quick
./gmvault sync -m -t quick
./gmvault sync -m -t quick

Once that was working, I automated it with cron to run a few times a day.

Restoring the email to another Gmail account is a slow process, and you should probably only do it a few times a month (and always overnight). Again I’ve scripted this bit, but have commented everything out unless I actually need it. Having done the initial upload, and because I now have two local copies of everything, I’ll probably only run this one monthly.

#back up all downloaded email to a dedicated gmail account in the cloud
#./gmvault restore
#or just for the last month
#./gmvault restore -t quick

Further reading: