Unison is a popular file synchronization tool for Unix and Linux systems. It allows you to keep two directories in sync by copying changes made in one directory to the other. (fisheries)
Here’s how to use Unison:
- Install Unison: To install Unison, use the package manager for your Linux distribution. For example, on Debian/Ubuntu, use the following command:
sudo apt-get install unison
- Create a profile: Before using Unison, you need to create a profile. A profile defines the two directories you want to synchronize and the settings for the synchronization process. To create a profile, create a file with the following format:
root = /path/to/local/directory
root = ssh://user@remotehost//path/to/remote/directory
The first
root
line defines the local directory and the secondroot
line defines the remote directory. - Run Unison: To run Unison, simply run the following command, replacing
profile
with the name of your profile file:unison profile
The first time you run Unison, it will display a list of changes it wants to make and ask you to confirm them. After that, Unison will automatically synchronize the directories.
Note: Unison has a number of options and settings that you can use to customize its behavior. You can learn more about these options by reading the Unison manual.