Automatically Backup your Gmail account on a schedule with GMVault and Windows Task Scheduler
It's nice to have your things backed up to the cloud, but you really need to have local backups as well. I have two 1TB pocket hard drives that I rotate between my home and the bank. They are labeled Offsite Backup A and Offsite Backup B. You can encrypt them with either Bitlocker To Go or TrueCrypt, and I do.
Related Links
- A basic non-cloud-based personal backup strategy
- On Losing Data and a Family Backup Strategy
- Give Grandpa and Grandma the gift of an off-site backup of your photos
I've got years and years of email in my only personal email account, powered by Gmail. I've recently started backing up my WHOLE gmail account with a wonderful free tool called GMVault. Setup requires a little attention to detail but once it's done, it's done.
Once installed, you run GMVault-Shell and type "gmvault sync youremail@address.com." The first backup will take HOURS and on Windows will put thousands and thousands of files in your C:\Users\YOURNAME\gmvault-db directory. You can move this directory if you want. My email backup was over 350,000 emails so I moved it to my larger D drive by using the -d option on the command line.
After this multi-hour sync was finally done, I wanted to make sure I updated the archive every week or so with backups of new emails.
Create a Scheduled Gmail Backup with Task Scheduler
Go to your start menu and type "Task" and run the Task Scheduler. Some folks don't even know this exists!
On the right side click "Create Basic Task."
Make it weekly or monthly or whatever makes you happy.
Your action is Start a Program
Make the Program like this and check your path first.
"C:\Users\YOURNAME\AppData\Local\gmvault\gmvault.bat"
Under Arguments, use sync -t quick like this. Be sure to use the -t quick or you'll get ALL your email again!
sync -t quick youremail@address.com
optionally you can point to a specific backup directory like this. If there is a space in your path, use quotes around it.
sync -t quick youremail@address.com -d D:\gmvault-db
I also made my task start in the same directory as GmVault, so "C:\Users\YOURNAME\AppData\Local\gmvault"
My scheduled task ended up with command line arguments like this:
sync -t quick scott@myemail.com -d D:\gmvault-db
You can test it by right clicking on it in the Task Scheduler list and clicking "Run." If you need to debug it or if it just starts and then quickly disappears, go into your gmvault.bat and add a "pause" command before the "exit" command to keep the window open long enough to see any errors.
Here's my automatic Gmail backup in action:
Hope this helps you!
This week's sponsor: Be part of GENERATION APP. Your Idea. Your App. 30 Days. Begin your 30-day journey to create a Windows Store style app and talk 1-on-1 with a Windows 8 app development pro. Get started today.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
What if you glued a Raspberry Pi to the harddrive and got that to do the syncing.
What if you had 2 harddrives and 2 Raspberry Pi's?
Be very careful about trying to change your Live ID email address. I started, then changed my mind (since it offered me the chance) and I've been locked out of my Skydrive, Mesh, Live Messenger, Windows Phone 7 updates, MSDN and just about everything else I've ever logged into using my Passport/Live ID.
They are working on it - I hope - but I can't get in on the new username and can't on the old one. Both say they don't exist.
2,000 plus photos. Ugh.
With CrashPlan headless running on the same Synology server this is going to be a real piece of mind. Thanks Scott for sharing it!
I would assume I could do the same thing with Thunderbird or any email client. While clearly Scott's way is more consistent and superior in its hands off approach, am I missing something fundamental with using a mail client?
Am I making a backup with my plan?
Thanks for all the helpful posts.
This backup is a complete one.
Thanks!
I ended up putting the full command (with parameters) inside another .bat file and ran that (no parameters) from a scheduled task without issue. Hey, it works. :-p
Thanks for the heads up Scott, and mega thanks to @zoobert for this fantastic utility. Let's definitely support his effort! My wife's and my GMail accounts are backed up every night now. So cool. :-)
Backups are taken on a daily basis for the pro account.
One thing I like to do with automated scripts is to create a simple log file. This way if I notice something is awry I have an idea of what happened.
In this case I just piped (>) the output to a text file in the same destination folder. Using your example:
sync -t quick scott@myemail.com -d D:\gmvault-db > D:\gmvault-db\log.txt
Another thing I noticed is that Windows Search can't search inside gzip files, so I turned compression off to give myself the ability to do so. My backup wasn't much bigger with it turned off, and I like having the option (although I doubt I'll ever use it).
If, as I suspect, it is email only, it's useless for me I'm afraid - I don't want multiple solutions for a backup process: This way lies extra maintenance & configuration and testing (you do test your backups, right?)
As a result the greater complexity = less 'security' and more chance something will fail.
Just my thoughts,
Tim.
nice work there.
you just lost respect from me.
Sam Port...really are you being serious which decade are living in?
If us readers want something a little simpler to set up there is another option called GeeBak, its paid for but cheap, it does incremental backups and sits in the tray backing up to a schedule (every hour or so).
www.starbanana.com/Products/Gmail-Backup
Im posting cos I got caught out using thunderbird, it SYNCs your emails as oppose to Incremental backups which effectively deletes your local PC emails to match your online emails! Doh!
Settings
Program/script:
cmd.exe
Add arguments:
/c start /min c:\path_to\gmvault.bat sync -t quick someone@gmail.com -d C:\path_to\Database ^& exit
Running this since a **long* time, saved my butt a number of times...
Thanks a bunch Scott!
Comments are closed.