In this tutorial, we will show you how to install and configure Unison on Ubuntu 16.04 LTS server. For those of you who didn’t know, Unison is a cross-platform, open-source file synchronization software that permits users to store copies of files and folders on two different hosts. When two files are merged with each other, the difference gets copied from one replica to another.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of Unison on a Ubuntu 16.04 (Xenial Xerus) server.
Unison features
- Unlike simple mirroring or backup utilities, Unison can deal with updates to both replicas of a distributed directory structure. Updates that do not conflict are propagated automatically. Conflicting updates are detected and displayed.
- Unlike a distributed filesystem, Unison is a user-level program: there is no need to modify the kernel or to have superuser privileges on either host.
- Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an encrypted ssh connection. It is careful with network bandwidth and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.
- Unison is resilient to failure. It is careful to leave the replicas and their own private structures in a sensible state at all times, even in case of abnormal termination or communication failures.
- Unison has a clear and precise specifications.
Prerequisites
- A server running one of the following operating systems: Ubuntu 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Unison on Ubuntu 16.04 LTS
Step 1. First, make sure that all your system packages are up-to-date by running the following apt-get
commands in the terminal.
sudo apt-get update sudo apt-get upgrade
Step 2. Installing Unison.
Add the PPA repository to your system, update the local repository index and install the unison package:
sudo add-apt-repository ppa:eugenesan/ppa sudo apt-get update
After updating the apt sources-list, run the following command to install the package:
sudo apt-get install unison
Once it is done, use the following command to view the Basic and Advanced options:
root@idroot.us:~# unison -help Usage: unison [options] or unison root1 root2 [options] or unison profilename [options] Basic options: -auto automatically accept default (nonconflicting) actions -batch batch mode: ask no questions at all -doc xxx show documentation ('-doc topics' lists topics) -fat use appropriate options for FAT filesystems -group synchronize group attributes -ignore xxx add a pattern to the ignore list -ignorenot xxx add a pattern to the ignorenot list . . watch when set, use a file watcher process to detect changes (default true) -xferbycopying optimize transfers using local copies (default true)
Check the version of Unison:
unison --version
Congratulations! You have successfully installed Unison. Thanks for using this tutorial for installing Unison on Ubuntu 16.04 LTS (Xenial Xerus) system. For additional help or useful information, we recommend you check the official Unison website.