Last Updated on June 23, 2023
As previously outlined, Unison can synchronize a local directory with another local directory, or with a remote directory.
Unison provides a simple and intuitive GTK user interface (GUI). Here’s an image of the graphical Unison in action. Unison is reporting the difference between my two defined directories.
Unison operates in several stages. The project reports these stages as:
- On each host, it compares its archive file (which records the state of each path in the replica when it was last synchronized) with the current contents of the replica, to determine which paths have been updated.
- It checks for “false conflicts” — paths that have been updated on both replicas, but whose current values are identical. These paths are silently marked as synchronized in the archive files in both replicas.
- It displays all the updated paths to the user. For updates that do not conflict, it suggests a default action (propagating the new contents from the updated replica to the other). Conflicting updates are just displayed. The user is given an opportunity to examine the current state of affairs, change the default actions for nonconflicting updates, and choose actions for conflicting updates.
- It performs the selected actions, one at a time. Each action is performed by first transferring the new contents to a temporary file on the receiving host, then atomically moving them into place.
- It updates its archive files to reflect the new state of the replicas.
After synchronizing, the status bar reports it’s complete, with 1 file skipped. There’s a tick next to all the files except compat.h.