Applescripted backup for Mail and Address Book
Even though there are a truckload of backup solutions for Apple Mail, ranging from Apple’s own Backup software to dedicated apps like Email Backup and many more, the statistics are damning.
During the keynote at WWDC this year, we learnt that only 25% of Mac users perform backups and only 4% of them do it in a fail-safe automated way.
So another option is always welcome.
Doug Blatti has written an applescript
that will backup your Mail folder and Address Book quickly, neatly and conveniently.
All you have to do is launch it. It will prompt you to close Mail and Address Book if they are open and go about its business:

It took about 9 minutes to create a zipped up backup of my Mail and Address Book. The zip file ends up at 620.5MB, just right for burning off onto a CD-Rom with some room to spare. (See further, “How the delete key is your best friend”).
That’s great. There’s only one problem. You.
Remember Apple’s high hopes that Time Machine in Leopard will drastically increase the number of people who do backups? As I’ve suggested before, they are kidding themselves:
Will it work? I don’t think so. The current ability to automate backups with Backup 3.0 and the plethora of third-party automated backup options haven’t brought large numbers of users to the party. This won’t either. It’s not the technical ability that’s missing; it’s the personal habit.
The best solution is to automate it with iCal, so that you are set free to develop more interesting and enjoyable personal habits.
It’s easy. Create an all-day event in iCal and under the alarm option, set it to “Open file”. Navigate to wherever you saved MailBackup.app and select it.
Set it to run at a time when you don’t usually use Mail.
I’m setting it to 9 am because I am having great success with the theory that you shouldn’t open your email until an hour or two after you start work (see more on this in “Emailing to live, not living to email”).
That’s the time to stay in control of your own agenda and actually get some stuff done.
Burn the backup file to a CD-Rom and store it somewhere safe. (Did you hear the one about the guy who kept his backup CD in his laptop case? One day his bag was stolen and…)
Now you are free to enjoy your bad habits worry-free. Your emails and contact details are safe.
NB: This script does not backup your Apple Mail preferences file, com.apple.mail.plist, which lives in your ~/Library/Preferences folder. Is it important? Ask Tim Bray
.
You can find some more backup apps in the Hawk Wings Plug-in and Add-on List and in the Related posts section below.
Tags: Address Book, Apple Mail, applescript, automation, backup, data security, iCal, mail.appRelated posts

December 15th, 2006 at 4:39 am
Better …
External firewire drive - for example:
http://www.lacie.com/products/product.htm?pid=10383
Every week or so:
1. Connect.
2. (Optionally) clean up those extra files Mac Os X has an unfortunate _penchant_ for:
sudo find / -name \.DS_Store -exec rm -f {} \;
sudo find / -name \.localized -exec rm -f {} \;
… or not, as you wish.
3. Issue command:
rsync -aE –delete ~ /Volumes/Whatever_name_I_assigned_to_my_backup_drive/Backups
4. eject … and …
5. (Optionally) move to a safe place - fireproof safe, if you’ve got one.
That will have backed up your _entire_ home area, including not only mail stores and addresses, but also documents, preference files and user-installed applications in ~/Applications.
I tend to export the address book from within the application _as well_ (File > Back up Address Book), as one would for other files such as browser bookmarks, and save that on a USB key, such as this:
http://www.sandisk.com/Products/Catalog(1013)-USB_Flash_Drives.aspx
But, yeah, to repeat … rsync is your friend.
December 15th, 2006 at 6:56 am
So, creating a backup of my Mail folders is cool, but is it actually something I can restore from? It’s not really clear what is in this backup or what I do with it if I have a failure.
December 15th, 2006 at 7:49 am
Hi Tim…
‘Alot of good stuff in this post.
* Backing up: I am now backing up using SuperDuper (after wasting money on a .Mac account partly to get ‘Backup’) and a Lacie external drive. I still don’t have this backup routine automated (but it does include all user files, incl Mail), and I still don’t have remotely -stored (recent) copies.
*Don’t check email for the first hour or two. Good advice for me as I have an email addiction. I check email straight away at home and at work, and also feel I need to respond to everything/everyone’s requests.
* The delete key is your friend. Yep, I hoard too much… (But other people find this habit of mine useful.. :-)
Good stuff, Tim! Keep up the good work,
Steve
December 15th, 2006 at 8:23 am
Post-script:
OK, Tim, I could do better on the back up front, but I am getting there.
Also, I am doing OK on some things: eg my Address Book, iCal and memos/notes are synced/backed up via Mark/Space with my Tungsten e2 PDA which is in turn synced with Palm Desktop on my work computer (a Windows machine).
I mentioned before I have just started using Super Duper: the only thing which I think Apple’s Backup does better is write backups to CDs/DVDs .. incl the ability to span multiple disks.
Will Time Machine be part of Leopard, or will we have to pay for an .Mac account to get it? Will Time Machine be backwards compatible with Backup?
So many questions…. :-)
Steve
December 15th, 2006 at 8:33 am
@Jon, the backup is a zip file preserving the directory paths of the original folders and files.
In the event of disaster, all you have you do is unzip it and replace the files in their original location in your ~/Library folder.
December 15th, 2006 at 8:35 am
@Steve, I got the very definite sense that Time Machine is built into Leopard and is not a pay-extra add-on. Whether or not it is backwards compatible is a good question. Since Apple makes software that “just works”, I’m guessing it will be :)
December 27th, 2006 at 1:20 am
The preference files have been added to the backup procedure. The newer version is available from the download link in the original post. I will be adding checkbox options for iCal data as well in a newer iteration.
@Mike - I don’t use this script myself, but it is handy for users. Rsync is the way to go if you know how to use it. I have a similar process where my entire home directory is rsync’ed with he server every night. You can automate some cool things behind the scenes with rsync.