Unison

From DreamHost

Jump to: navigation, search

Contents

Unison Download Binary to Dreamhost

Although the original instructions allow you to build unison from scratch, it's a bit of a faff. Thankfully, there is no need.

Create a local bin folder

  • Log in using SSH
 mkdir ~/bin
  • Add ~/bin to your path in ~/.bashrc
 export PATH=~/bin:$PATH

Download the binary from the Debian Packages archive

  • Download the unison_*_i386.deb file from Debian Packages
  • Search for unison
  • Download the version for the latest stable version of Debian (Lenny as at 2009-04)

Unpack the binary

  • Unpack the .deb file (on Windows, the IZArc tool will do this)
  • Look for data.tar.gz and unpack that, then unpack the data.tar it contains
  • Drill down to /./usr/bin/ and extract the unison-* file that is >0 bytes

Transfer to Dreamhost

  • Transfer the unison-* file to ~/bin/ on Dreamhost using SCP or similar
  • Change the permissions to allow it to run
  chmod +x ~/bin/unison-*
  • Rename to unison or
 ln unison-<tab> unison
to make it easier to run (just press the tab key where it says <tab>)
  • Test that it works and enjoy 2-way, rdiff based syncronisation!


Unison Compile on Dreamhost

These instructions install ocaml and unison in your home directory in $HOME/sw/bin

Compiling Objective Caml

  1. download ocaml from http://caml.inria.fr/
    1. untar ocaml into a directory
    2. cd into the ocaml directory
    3. Issue this command: chmod -R 0777 *
    4. Issue this command: ./configure -prefix $HOME/sw && make world && make bootstrap && make opt && make install

Add the directory to your path

I use bash so i edited my ~/.bash_profile to have the path include ~/sw/bin example:

PATH=~/sw/bin:$PATH
export PATH

Getting the updated path

you can either

source ~/.bash_profile

or just logout and log back in.

Compile Unison

  1. edit the Makefile on line 71 I changed the install directory to also be ~/sw/bin by making the line read:
INSTALLDIR = $(HOME)/sw/bin/
  1. make
  2. make install

there you have it unison is now installed in $(HOME)/sw/bin at this point delete the tarballs and the temporary directories that you compiled ocaml and unison in.

Using Unison

To synchronize a directory locally with a directory on your server here is a sample command.

~/ $unison ~/somefilesLocally ssh://YOURDOMAIN.com//home/USERNAME/somefilesRemotely 
 -batch -servercmd ~/sw/bin/unison -times -terse

An issue you may find is that unison expects the unison command on the remote (Dreamhost) end to be in /usr/bin, if you've followed the instructions at the top, it will be in ~/bin. To fix that, add the parameter

 -servercmd ~/bin/unison

Another issue might be that your local version of unison is different to the servers version, they really need to be at a similar revision level. For example 2.27.43 and 2.27.57 would probably be OK but 2.26.99 and 2.27.57 would not.

Personal tools