Today I discovered Unison. It seems not to be in active development anymore but it is rather stable and feature rich. But what is it for? As one can guess from the title that it synchronises two folders in both directions. There can be many profiles for different pairs of folders in which one can define which subfolders to exclude, that symlinks should be followed and so on.
Below I want to show how I configured Unison and integrated it into KDE.
At first Unison needs to be installed. On OpenSUSE zypper install unison was working quite well.
Now Unison can be started by executing unison.
The GTK+ interface of Unison opens and presents a wizard which allows you to configure the profile. Unison’s main window looks like this:
“Rescan” allows to scan the files in both directories. Unison selects a default action which says that the file or folder is copied to the other folder if you click on “Go”. The buttons “Right to Left”, “Skip”, “Left to Right” and “Merge” allow you to define another action if Unison did not detect the right one. In order to change the current profile click on “Change Profile”:
The current profile can be changed by selecting another profile and clicking on “Öffnen” (English: “Open”). “Bearbeiten” (English: “Edit”) allows to set some special properties:
At the bottom a description of the selected “fat” option can be seen. The “follow” option contains a list of symlinks which should be followed rather than ignored. The dialog which allows to set other properties (you can open it by clicking on “Hinzufügen” (“Add”)) lists some of them (the others can be shown by checking a checkbox). Every property has its own description which tells you a lot about it.
After setting up the profile correctly I wanted KDE to show me an action “Synchronise” if my flash drive “JanGerrit” is plugged in. This can be achieved by opening the “Device actions” KCM:
“Hinzufügen” (“Add”) allows to create a new action. There you need to set the command to /usr/bin/unison <ProfileName>. In order to not show the action for every flash drive but only for the flash drive the profile is for you can edit the second condition to check for the device’s label or another unique property.
The following links provide some information:
As always: comments are very much appreciated. You may comment on my language as I really want to improve it or the content as well as on any other thing you notice.