Posts RSS Comments RSS 48 Posts and 155 Comments till now

How to back up Address Book automatically

For quite a while now you’ve been able to manually backup your entire Address Book. This has saved many people massive heartache when they’ve had their machines go down/did an OS re-install or various other scary things (Yeah, I know, if you have MobileMe you don’t need to do this but most people don’t).

The big issue with backing up this way, as with any backup, is getting people to do it and do it regularly. To backup your Address Book all you need to do it copy the /Users/”user name”/Library/Application Support/AddressBook folder in each users home directory. Simple, direct and easy. But you may have noticed that when you do a manual backup via the Address Book application you get a file with the “.abbu” extension. That’s just the AddressBook folder renamed and getting that extension. The beauty of having this file is when you want to restore your Address Book via the menu you can just point to this file. Otherwise you have to drag the backed up folder to the original spot. Again, not hard to do but some users have problems doing things that go outside of clicking on a menu item.

So, to back up your Address Book and put it in nice “.abbu” file for easy restores just do this:

filedate=`/bin/date "+%m-%d-%y"`
cp -R "/Users/username/Library/Application Support/AddressBook" "/Users/username/Documents/Address Book Backups/Address Book Backup $filedate.abbu"

Obviously you change the “username” section to the name of the home directory. Also, you can change the backup folder to what ever you want. This script just appends the current date to the backup so you can keep multiple backups if needed.

To run this you have a bunch of options:

  1. You can run it via cron or launchd. Just put the two lines together and seperated by a “;”.
  2. You can run it as an Automator iCal plug-in. Just drag over the “Run Shell Script” action and paste in the script. Then schedule it via iCal.
  3. You can save it as a script and run it from what ever automation application you prefer.
Be Sociable, Share!

Trackback this post | Feed on Comments to this post

Leave a Reply