Hooray! I now have a functional script for copying my iCal, Address Book, and Safari bookmarks. I suspect it's copying more than necessary, so I may refine it, but it's doing what I need now. I am amazed at how many places Apple sticks calendar data!

A big thank you to the rsync and OpenSSH developers. Once again, the script is largely comments, but that's good -- it is fundamentally simple.

Here is version 1.0 -- please check http://www.extrapepperoni.com/category/computers/synchronization/ and http://www.reppep.com/~pepper/code/ to see if there's a newer version.

I wrapped the lines here to make it more readable.


#!/bin/sh
# rsync-dotmac.sh
# v1.0, 2007/07/11 by Chris Pepper
# Check for a newer version at:
# <http://www.extrapepperoni.com/category/computers/synchronization/>
# <http://www.reppep.com/~pepper/code/>

for h in mac1 mac2
 do
  ssh $h rm -Rf ~/Library/Caches/com.apple.iCal ~/Library/Caches/iCal \
   ~/Library/Caches/Metadata/iCal \
   ~/Library/Preferences/com.apple.iCal.alarmsCache.plist \
   ~/Library/Preferences/com.apple.iCal.AlarmScheduler.plist \
   ~/Library/Preferences/com.apple.iCal.plist \
   ~/Library/Preferences/com.apple.iCal.sources.plist \
   ~/Library/Preferences/com.apple.iCalSync.AlarmScheduler.plist
  rsync -va --delete ~/Library/Application\ Support/AddressBook/ \
   $h:"Library/Application\ Support/AddressBook/"
  rsync -va --delete ~/Library/Application\ Support/iCal/ \
   $h:"Library/Application\ Support/iCal/"
  rsync -va --delete ~/Library/Calendars/ $h:Library/Calendars/
  rsync -va --delete ~/Library/Safari/Bookmarks.plist \
   $h:Library/Safari/Bookmarks.plist
 done

# To use, enter your read-only hostnames on the 'for' line above.
# They must, of course, be accessible from the system you run this script on.
# The script pushes data (Address Book, iCal, and Safari bookmarks) from
# a master to one or more read-only systems. It is intended as a free
# replacement for a part of Apple's .Mac service that caused me some
# frustration.
# I wish Apple provided a way to tell those applications not to allow
# (futile) changes on read-only systems, although with .Mac services
# that should not be necessary.
# I don't sync ~/Library/Keychains/, because my keychain items vary
# between systems, so unidirectional sync would be suboptimal.
# You may get warnings when going between OS versions; I have had no
# trouble just ignoring them (so far).
# If you get double birthdays, try disabling and re-enabling the
# Birthdays calendar in iCal's Preferences.