Simply Top Ad

Monday, June 14, 2010

Unison seems to be interesting

Humyo turned out to be not as good as I'd hoped for.

I was still looking for a way to synchronise my lappy (or at least bits of it) with a server.

So I thought I would have a go with Unison.

So far it seems to be working out OK.

The old Unison 2.27 that you get with your average Linux distro is a bit pants because it does not support Unicode filenames. You need something a bit newer like 2.32.

At the minute I seem to be ending up with Unison 2.40 everywhere.

Unison comes with an X.Y.Z version number and you need to have the same X.Y at both ends of the link for it to work.

So I am using the standard pre-built Windows GTK build of 2.40.something, and building my own one on the Linux side.

For some reason, Unison 2.40 insists that it needs Ocaml 3.11.2, which is the latest released version. Ocaml is a big old beast to build yourself. You really want to be using a pre-built package version. So I have ended up going to Ubuntu 10.04 Lucid which includes Ocaml 3.11.2.

To get Unison on Windows to be able to call up the Linux box, I use "plink" out of PuTTY. I was previously using SSH out of cygwin, but using plink seems to involve less overall weirdness. To get Unison to be able to invoke plink (relatively) smoothly, I used a shim script called ssh2plink.bat.

Unison is quite neat in the way it synchronises. It seems to be able to spot files with the same content, even if they have different name. So you can happily pick up a tree and move it somewhere else, and Unison will synchronise it quickly without having to re-upload or re-download the whole tree. This also seems to work with tree copies.

One thing I have been doing is having two lappies synchonised with the server. This, coupled with the fact of having all e-mail accessed by IMAP meant I could switch from working on one lappy to the other lappy with ease.

I eventually stumbled across the fact that Unison does not propagate file modified timestamps by default. There is an option ("times") which can be turned on easily enough, but for some unknown reason it is not enabled by default.

No comments:

Post a Comment