Synchronize iCal on multiple machines via WebDAV

Apr 15, '05 09:58:00AM

Contributed by: archimed

This is a simple hack, and I can't believe it took me months to realize some of iCal's sync problems can be solved with a quick Unix symlink. While iCal can publish-to or subscribe-to a calendar, it can never do both at the same time. For most of us using WebDAV services on our Apache servers, that creates the problem of synchronizing our calendars across multiple machines. iCal will be happy to update its .ics files on a server, but it never reads back from those files when it loads.

The solution? Symbolic link the default calendar storage *folder* to your WebDAV server (not the individual .ics files, because iCal overwrites those). This method will insure that iCal will read the symlinks every time when its loaded, and write-to the symlinks every time it is closed. The idea came from the iCal weblog, so this is nothing new, although I'm shocked that more people do not use this method.

Instructions:

  1. Close iCal if it is running by hitting Command-Q.
  2. Upload your .ICS calendar files from ~LibraryCalendars to a folder on your WebDAV server (ie, a folder called "Calendars")
  3. Back up your .ICS calendar files from ~LibraryCalendars just in case anything goes wrong.
  4. Load up Terminal, and delete your iCal calendar folder by typing rm -rf ~LibraryCalendars -- but before you do so, make sure you've performed the previous step to create a backup!
  5. Connect to the WebDAV service through the Finder by hitting Command-K (Go: Connect to Server).
  6. Enter the web address of the WebDAV server you are trying to connect to. For example, your WebDAV document folder might be at the address http://www.myexample.com/mydocuments
  7. Once connected to your WebDAV server, load up Terminal again and navigate to ~/Library/ by typing cd ~/Library.
  8. Make a symbolic link between your WebDAV server folder and the 'Calendars' folder (that you deleted earlier) on the local machine by typing ln -s /Volumes/mydocuments/Calendars.
The last step is crucial, as it links the Calendars folder that iCal reads its .ICS files from to the remote server that actually has the files stored there. iCal treats this 'symbolic' folder just as it would a normal folder. So what's the 'hack'? Well, not much of one. We're just fooling iCal into thinking the files it's reading and writing are stored on the local machine, not on a remote machine.

The only warning I have to offer is that make sure that you are already connected to your WebDAV server before launching iCal, or I'm sure nothing will appear in your calendar. Or worse, it's possible that iCal will create a new 'Calendars' folder and waste all your hard work symlinking it.

[robg adds: I haven't tested this one...]

Comments (17)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050414182034814