Table of Contents
Unison
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:
Laptop
root = /home/gm4slv/test_dir root = ssh://gm4slv.org.uk/test_dir sshargs = -C
VPS
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:
https://github.com/bcpierce00/unison/releases/tag/v2.51.3
Unpacked and moved unison
to /usr/local/bin
on the VPS.
Success
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 : 06/03/25 06:49 GMT
John Pumford-Green Tue May 3 22:29:31 2022