Unison
From DreamHost
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
~/binto your path in~/.bashrc
export PATH=~/bin:$PATH
Download the binary from the Debian Packages archive
- Download the
unison_*_i386.debfile 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
.debfile (on Windows, the IZArc tool will do this) - Look for
data.tar.gzand unpack that, then unpack thedata.tarit contains - Drill down to
/./usr/bin/and extract theunison-*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
unisonor
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
- download ocaml from http://caml.inria.fr/
- untar ocaml into a directory
- cd into the ocaml directory
- Issue this command: chmod -R 0777 *
- 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
- 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/
- make
- 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.

