Tuesday, September 1, 2009

Unison - Two-way file synchronizer

I've found a great tool to keep my laptop work files in sync with my desktop(s).

For my day-to-day work, I use a Mac laptop with multiple operating systems installed, and 3 desktop machines. This way I have both a laptop and a desktop version of MacOS, Windows, and Linux.
My web work often involves all three systems, and my desktop application development usually includes both the Mac and Windows systems.
I used to run Retrospect and backup everything to tape, but now, I just put most projects in version control and replicate everything on all the boxes.

Not really a backup system, but since the boxes live in different facilities, I'm covered against catastrophic loss.

Here's the catch: I manually do these updates every day.
Every day.
For years.

I've used a number of sync tools in the past, but something would fail, and I would find myself back to the manual system.

On a current project, I found myself needing to synchronize many hundreds of gigabytes of media files. I messed up the first pass, and started researching alternative sync tools.

Enter Unison.
Similar to rsync and other tools, Unison has the added ability to "mirror both ways" and runs fine on Mac, Windows, and *nix.

It has a high degree of safety, since it marks file that conflict and lets you interactively choose what to do with them.

For those concerned with such things (and you know who you are), it runs as a user-level application.

There are graphical versions available, but I'm just running the command-line version on all platforms.

The very first version of Unison was written in a research language called Pict, in 1995. There was a Java version in 2007. Trevor Jim and Jérôme Vouillon joined Benjamin Pierce on the project when the codebase moved to Objective Caml in 1998.

So far, I've just synced my Mac and Linux boxes.
I didn't want all the mac-specific invisible files cluttering up the other machines so I added some filters to the Unison preferences.
You can do this with command-line options, but I just add the filters to my Unison Profile.

Here's my ~/.unison/default.prf file:

# Unison preferences
fastcheck = true
ignore = Name *.tmp

ignore = Name Thumbs.db

ignore = Name .DS_Store

ignore = Name .Trash

ignore = Name Icon

I've set up a "canonical" copy of my work folder on a server in the cloud.
Each of the machines is now running Unison over ssh to sync to that central server.
So far, so good...

Like Ophcrack, Unison is an open source project that just works.
My favorite kind of software!

Technorati Tags: , , , , , ,

No comments:

Post a Comment

Please leave your comment here.