Unison and CCS

Unison (www.cis.upenn.edu) is a file synchronizer that works over SSH and does a fantastic job of keeping files and directories on two different hosts in sync. I use it to keep files in sync between my laptop (running Linux) and CCS.

Unison on CCS is version 2.9.1--you have to use the same version on your local machine.

I start the unison synchronization process from my laptop. Because of that, I had to make sure that the unison command was in my path. Easy way to figure this out is to do this:

  ssh -l username login.ccs.neu.edu 'echo $PATH'

If it prints out /arch/unix/bin (where unison is located) then you're fine. Otherwise you'll have to add that to your PATH. I have bash as my shell and so I added /arch/unix/bin to my PATH in my .bashrc file:

  export PATH="${PATH}":/arch/unix/bin

After that, I created a ccs.prf file in my ~/.unison directory with this in it:

  root = /home/willg/classes/
  root = ssh://guaraldi@login.ccs.neu.edu//home/guaraldi/classes

That synchronizes the files between /home/willg/classes on my laptop and /home/guaraldi/classes on CCS.

If you want to maintain mtime, atime, and ctime between the replicas, add:

  times = true

to your .prf file.

You can additionally tell unison explicitly which files and folders to synchronize as well as what kinds of things to ignore. There's more in regards to this in the unison manual on the unison site.

If you have questions, let me know: guaraldi at ccs dot neu dot edu .