Manually backup iCal
iCal allows you to create a backup file by selecting File > Back up iCal. You can later restore iCal by double-clicking the backup file. Restoring iCal from a backup works great as long as you have a recent backup. But that’s rarely the case.
What if you could configure iCal to create backups automatically? You can, with a little help from AppleScript.
Automatically backup iCal
This script will backup iCal when run. You can create alarms in iCal to run scripts. To configure iCal to back itself up every day, create a repeating alarm in iCal that runs this script. Here's how:
- Save this iCal Backup script to your Applications folder.
- Create a new event in iCal that repeats every day (e.g. 11:00 PM).
- Set the Alarm type to Run Script. Then choose Other... and select the iCal Backup script stored in the Applications folder.
When finished, the Event Details should look something like this:
Now every night at 11:00 PM, iCal will run the AppleScript and back itself up. And, iCal does not have to be running for the script to run.
By default, the script creates backup files that are date and time stamped (iCal 2008-11-14 23.00.00.icbu) and stores them in ~/Documents/iCal Backups. It archives up to 10 day’s worth of backups and deletes the older backups.
Customize the AppleScript
If you want to alter the location of the backup directory or the number of archives to save, you can open the AppleScript with Script Editor (in /Applications/AppleScript) and change these variables:
To change the backup folder, edit this line:
set destDir to myHome & "Documents/iCal Backups"
To change the number of days to archive, edit this line:
set deleteAfter to 10
Download link is bad...
Posted by: Damien | November 18, 2008 at 08:06 AM
The download link is fixed. Sorry about that.
http://www.busymac.com/download/icalbackup.zip
Posted by: John | November 18, 2008 at 09:01 AM
Just wanted to post to your blog to say thank you for the busysync tool for google. Wonderful stuff - and now my ical life can sync with my blackberry using google as the master (which beats the crap out of the Blackberry Mac tools which dont even work on the new mbp).
Well done.
Suggestion: Make a sync utility for google contacts aswell?
Posted by: Paul Mooney | November 25, 2008 at 12:34 AM
Fantastic! Thanks. You may want to promote Dropbox (http://www.getdropbox.com) as way to nicely save these backups. They are smallish and perhaps valuable remotely in the happenstance of the Spanish Inquisition, or some other 'unexpected' circumstance...
Posted by: Greg K. | November 30, 2008 at 06:14 AM
Should have said: "...as a nice destination to save these backups."
Posted by: Greg K. | November 30, 2008 at 06:16 AM
In you example for creating an iCal event entitled "Backup iCal", there is no 'calendar' shown. I have 6 different calendars on my iCal. Do I have to make a separate backup event for each one? I would then have 6 "backup" events showing up on my calendar on every day 7d a wk, every wk, etc. I wonder if I can somehow not display the "backup" event on my monthly calendar.
Posted by: Monica Schaeffer | December 11, 2008 at 07:47 PM
Monica, the backup script will backup all calendars. You can put the event that launches the script on any calendar you want. You could also create a new calendar that contains the repeating event, and uncheck the calendar to hide the events on it.
Posted by: John | December 11, 2008 at 08:16 PM
this is a great feature! thanks.
Posted by: Naruto Manga 453 | June 24, 2009 at 08:32 PM
I have followed your process for backing up my iCal, even created an ICal Backups folder in my Document folder but nothing has happened, no backups have been made. Any help you can give would be extremely helpful.
Posted by: Rob Pennington | July 12, 2009 at 11:44 AM
As further information, the scrip works when run from Script Editor but apparently nothing happens from the Calendar Event. I did notice the the file I downloaded from this site had the title "iCal Backup" but as I see it above it says "iCal Backup.scpt". I don't know if that makes any difference but I have change the title to add the .scpt which immediately showed up in the Calendar Event alarm. We'll see.
Posted by: Rob | July 13, 2009 at 08:32 PM
Nope, still doesn't work from my calendar event alarm. Any suggestions? Sure do need this as I am regularly losing all my calendar information.
Posted by: Rob | July 14, 2009 at 11:34 AM
Rob -- Sorry, I can't help you with the script. What I can recommend, however, is that you check out BusyCal (http://www.busymac.com/busycal ) when it's released. It has automatic backups built-in.
Posted by: John | July 14, 2009 at 12:01 PM
Well I finally figured it out. In iCal's preferences, under the Advanced tap, there is a check box next to "Turn off all alarms". It was checked. Duh! Well, at least my discovery might help someone else.
Posted by: Rob | July 21, 2009 at 08:17 PM
Nice blog, valid points, thanks for the info
Posted by: Wholesale | July 22, 2009 at 03:02 AM
Your Ical Backup is great !
I am just looking for an applescript to export a calendar to a ics file.
have you a solution ?
Posted by: rene | February 21, 2010 at 07:30 AM
imax Pills - Enlarge your penis size up to 3-4 Inches in length and up to 25% in girth without surgery.
Posted by: vimax | March 05, 2010 at 05:46 PM