iCal Backup Script
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