Revision 16 as of 2008-05-30 01:30:03

Clear message

Unison is a GUI and terminal-based tool which allows files to be kept in sync with each other, locally, on a network and on different operating systems. Changes can be made on the machines, and Unison will update the machines with the correct versions of files and folders.

Examples of uses

Heres a few scenarios on which Unison would be useful:

  • Justine has a lot of music and would want to back it up to another drive just incase her main drive fails. Unison can synchronize any new music she has added on her main hard drive, and will delete any music she has deleted from her main drive.
  • Ryan has a laptop and a desktop computer. He works on both regularly and wants to be able to have his latest work available on the computer he wants to use. Unison will be able to syncronise both computers over the network using SSH so that work he has done on his desktop will appear on his laptop, and when he wants to use his desktop again, he can sync the files to they are updated there.

Installation

Unison can be found in Ubuntu's Universe software repository, in the unison package. See InstallingSoftware for information about installing software, and ["Repositories"] if you need help enabling Universe.

In order to use Unison with Ubuntu and Microsoft Windows, you will need to have Samba installed and setup. For instructions on setting up Samba in Ubuntu, visit the SettingUpSamba wiki page.

GUI usage

Unison includes a GUI interface that allows you to graphically work with the application. You can usually get to it by going to Applications > Accessories > Unison or by pressing Alt+F2 and typing "unison".

Profiles

Different sync jobs in Unison are called "Profiles". For example, you may have a profile that synchronizes your music folder between two computers on a network, and another profile that synchronizes files between two drive. On starting Unison you will be presented with a window that allows you to select an existing profile or create a new one.

Choosing a profile

When you start Unison, you will be asked which profile you would like to use.

To change the profile you are using while inside Unison, go to Synchronization > Select a new profile from the profile dialog, or press P.

Making a new profile

On selecting Create New Profile you will be asked to enter a profile name. This name will represent the sync job when the Profile list appears when starting Unison.

As the profile is new Unison will guide you though the steps of setting the root directories, which are the directories to be synced as part of the profile. The first root should be a local directory for example "/home/[Username]/Music/". The second root can be local or on a target machine. Unison allows synchronization to be carried out over a network using SHH (further information at ["SSHHowto"]), RSH or a specific port on the target machine.

Once this is complete Unison will scan the two locations and show the differences.

Terminal usage

Unison can be used from the terminal. This is useful as it allows you to make quick synchronizations with folders, making Unison good for copying folders as backups.

The following is a simple example to synchronize a music directory between two PC's.

unison /home/[Username]/Music /location_of_samba_directory

Or if a profile has been created.

unison "USB Stick"

Notice you do not need to specify a path, Unison searches in /home/[Username]/.unison/ for a corresponding profile.

Depending on the size of the directories and the amount of files, a good amount of time may be needed.

Unison can be setup to run on a schedule. This can be done by utilizing the "cron" scheduler. Further information regarding cron can be found at the CronHowto wiki page.

Further Help

Included in Unison is a great help section, it can be found via the GUI under Help. Its topics include the different interfaces, the basic concepts and ways of running Unison. I would highly recommend reading this for more detailed information.

To access Unison's help from the terminal, use:

man unison

or

unison --help

CategoryDocumentation CategoryCleanup