Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

SUSE Linux Enterprise Desktop Deployment Guide
Previous Page Home Next Page

37.3 Introduction to Unison

Unison is an excellent solution for synchronizing and transferring entire directory trees. The synchronization is performed in both directions and can be controlled by means of an intuitive graphical front-end. A console version can also be used. The synchronization can be automated so interaction with the user is not required, but experience is necessary.

37.3.1 Requirements

Unison must be installed on the client as well as on the server. In this context, the term server refers to a second, remote host (unlike CVS, explained in Section 37.1.2, CVS).

In the following section, Unison is used together with ssh. In this case, an SSH client must be installed on the client and an SSH server must be installed on the server.

37.3.2 Using Unison

The approach used by Unison is the association of two directories (roots) with each other. This association is symbolic—it is not an online connection. In this example, the directory layout is as follows:

Client:

/home/tux/dir1

Server:

/home/geeko/dir2

You want to synchronize these two directories. The user is known as tux on the client and as geeko on the server. The first thing to do is to test if the client-server communication works:


unison -testserver /home/tux/dir1 ssh://geeko@server//homes/geeko/dir2

The most frequently encountered problems are:

  • The Unison versions used on the client and server are not compatible.

  • The server does not allow SSH connections.

  • Neither of the two specified paths exists.

If everything works, omit the option -testserver. During the first synchronization, Unison does not yet know the relationship between the two directories and submits suggestions for the transfer direction of the individual files and directories. The arrows in the Action column indicate the transfer direction. A question mark means that Unison is not able to make a suggestion regarding the transfer direction because both versions were changed or are new.

The arrow keys can be used to set the transfer direction for the individual entries. If the transfer directions are correct for all displayed entries, simply click Go.

The characteristics of Unison (for example, whether to perform the synchronization automatically in clear cases) can be controlled by means of command-line parameters specified when the program is started. View the complete list of all parameters with unison --help.

Example 37-1 The file ~/.unison/example.prefs

root=/home/tux/dir1
root=ssh://wilber@server//homes/wilber/dir2
batch=true

For each pair, a synchronization log is maintained in the user directory ~/.unison. Configuration sets, such as ~/.unison/example.prefs, can also be stored in this directory. To start the synchronization, specify this file as the command-line parameter as in unison example.prefs.

37.3.3 For More Information

The official documentation of Unison is extremely useful. For this reason, this section merely provides a brief introduction. The complete manual is available at https://www.cis.upenn.edu/~bcpierce/unison/ and in the SUSE package unison.

SUSE Linux Enterprise Desktop Deployment Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire