Syncing Application Data Between Machines

Syncing data between machines hasn’t been an issue for me over the last 3 years because my PowerBook has been my primary development machine. Now that I’m back on a desktop as my primary machine, it’s something I have to deal with again.

Let’s take browser bookmarks as an example. I still want to keep my PowerBook updated with my web toolset; a toolset that includes a number of bookmarks and bookmarklets which are used in conjuction with LaunchBar.

Before it is suggested, is great for social bookmarks, but it’s really more of a public browsing history with notes than it is a way to manage traditional bookmarks. There are other solutions out there that let you store your bookmarks online and/or sync them between machines, but they just don’t work (or interoperate with other apps like LaunchBar) as well as native application bookmarks do.

I’ve solved this problem with what I consider to be a rather clever solution (though perhaps there are dozens of developers out there already doing the same thing): check my bookmarks.plist into Subversion and check it out on each of my machines. When I add a bookmark on one machine, I just check it in and update on the other machine – and vice versa.

I’m not a Subversion whiz so there may be a better way to do this1, but this is how I set it up:

  1. First, make sure Camino isn’t running.
  2. I created a “camino” directory in my subversion repository, added the current bookmarks.plist (in “Application Support/Camino” to it and checked it in.
  3. Since I couldn’t figure out a way to check out an individual file from Subversion2, I went into my “Application Support” directory and checked out the “camino” directory I’d created in step 2 as “Camino-svn”.
  4. Now copy the contents (you don’t have to copy the bookmarks.plist file, but it doesn’t matter) of the “Application Support/Camino” directory to the new “Application Support/Camino-svn” directory you created in step 3.
  5. Delete the “Application Support/Camino” directory and rename the “Application Support/Camino-svn” directory to “Application Support/Camino”.
  6. Launch Camino and use normally.

Repeat on all computers you want to sync bookmarks between. Whenever you add a bookmark on a computer, just commit the changes and update on the other machines. For Camino, you don’t even need to quit the program before checking in your changes – bookmark changes are written to the bookmarks.plist file immediately. I may set up a CRON job to do the update every 24 hours or so on each machine. Maybe I should make the CRON job an AppleScript that quits Camino (saving any window/tab URLs), updates the bookmarks, relaunches and restores the windows/tabs. Lots of fun possibilities.

This technique should work with Firefox3 as well – really with any browser or data that is stored in a text file. I also set up my rules (Library/Mail/MessageRules.plist) and smart mailboxes (Library/Mail/SmartMailboxes.plist).

  1. Please let me know in the comments if there is. [back]
  2. Is this possible? [back]
  3. I think it would work cross-platform (Mac & Windows) as well, but I haven’t tested this. Once Firefox catches up with Camino on the Mac, this could be a compelling reason to switch. [back]