RF Eclectica Wiki

Try to learn something about everything, and everything about something - Thomas Huxley

User Tools

Site Tools


Table of Contents

02 : Computers


I used unison previously to maintain sync/backup of files between machines on my own LAN.

This has been used to keep files on a PC synchronized to the Dropbox folders on another PC, and thereby with the Dropbox cloud.

Now that I have access to a remote Debian Linux VPS machine I thought I'd revisit the use of Unison to keep folders synchronised - perhaps to keep a remote backup of certain files.

You can never have too many backups

I installed the Debian package of unison on the new VPS machine and made a matching pair of configurations - one on the VPS and one on the Shack Laptop (which already has unison installed).

The configurations:


root = /home/gm4slv/test_dir
root = ssh://gm4slv.org.uk/test_dir
sshargs = -C


root = /home/gm4slv/test_dir
root = ssh://gm4slv.plus.com:27659/test_dir
sshargs = -C

Unison version

I put some files in one “test_dir” and ran

unison vps

from the Shack Laptop and got this:

Unison 2.51.3 (ocaml 4.11.1): Contacting server...
Fatal error: Received unexpected header from the server:
 expected "Unison 2.51 with OCaml >= 4.01.2\n" but received "Unison 2.48\n\000\000\000\000\017",
which differs at "Unison 2.4".
This can happen because you have different versions of Unison
installed on the client and server machines, or because
your connection is failing and somebody is printing an error
message, or because your remote login shell is printing
something itself before starting Unison.

Incompatible versions. Laptop is running Debian 11 “Bullseye” and the packaged version of Unison is 2.51.3, whereas the VPS machine is running Debian 10 “Buster” and that has Unison version 2.48.

I've had this happen before, Unison is very touchy about having the same version at both sides.

I removed the older 2.48 from the VPS and downloaded a matching V2.51.3(ocaml 4.11.1) from github:


Unpacked and moved unison to /usr/local/bin on the VPS.


Now I was able to sync between the machines.

Adding the SSH public keys from both machines to the '~/.ssh/authorized_keys2'' of its peer meant it all went ahead without password prompting.

Now I have two “mirrored” directories on two separate machines I can use the VPS as a low-key remote file store.

Page Updated : 04/04/24 21:37 BST

John Pumford-Green Tue May 3 22:29:31 2022

public/computers/unison.txt · Last modified: 04/04/24 21:37 BST by john