Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Edgy,Feisty,Gutsy,Hardy

  • Subscribe RSS Feed

    subscribe to the ubuntu Geek RSS feed




  • Sponsor

  • Categories

  • Meta

  • Sponsor

  • Archives



  • WidgetBucks - Trend Watch - WidgetBucks.com

Unison - file synchronization tool

Posted by admin on May 11th, 2008 Email This Post Email This Post

Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

Unison shares a number of features with tools such as configuration management packages (CVS, PRCS, Subversion, BitKeeper, etc.),distributed filesystems (Coda, etc.), uni-directional mirroring utilities (rsync, etc.), and other synchronizers (Intellisync,Reconcile, etc).

Unison Features

Unison runs on both Windows and many flavors of Unix (Solaris, Linux, OS X, etc.) systems. Moreover, Unison works across platforms,allowing you to synchronize a Windows laptop with a Unix server, for example.

Unlike simple mirroring or backup utilities, Unison can deal with updates to both replicas of a distributed directory structure.

Updates that do not conflict are propagated automatically. Conflicting updates are detected and displayed.

Unlike a distributed filesystem, Unison is a user-level program: there is no need to modify the kernel or to have superuser privileges on either host.

Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an encrypted ssh connection. It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.

Unison is resilient to failure. It is careful to leave the replicas and its own private structures in a sensible state at all times,
even in case of abnormal termination or communication failures.

Unison has a clear and precise specification.

Unison is free; full source code is available under the GNU Public License.

Install Unison in Ubuntu

sudo aptitude install unison-gtk

This will complete the installation

Using Unison

If you want to open goto Applications—>Internet—>Unison

When you run it in GUI mode for the first time, you’ll be prompted to create a new synchronization profile. Simply specify the paths to the directories you want to keep in sync and you are done.

Enter First Directory

Enter Second Directory.As you can see, Unison supports synchronization via SSH, which is a handy feature for syncing remote machines.

Unison then checks both directories and displays all the files to be synchronized. Pressing the Go button performs the sync.

Although the basic operation of Unison is pretty straightforward, it offers a few advanced features, including a powerful and flexible conflict-resolution mechanism that provides a comprehensive set of options.

Once Unison has scanned the directories,you can specify the way it should handle conflicts with the options available under the Actions menu. For example,you can choose to solve conflicts in favor of the desired directory by choosing either the Resolve all conflicts in favor of first root orResolve all conflicts in favor of second root command. Also, you can force all changes from one directory to another and replace older files with newer ones.

Specifying all the synchronization settings manually each time you run Unison is hardly ideal. Fortunately, Unison provides an elegant solution – multiple profiles: For each profile, you can specify settings in a .prf file and save it in the ~/.unison directory.

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

8 Responses to “Unison - file synchronization tool”

  1. Scott Says:

    I’ve been looking for a utility to sync my documents between desktop and laptop, and this might be just the thing. Is it easy to schedule syncs via cron, or at startup? Also, can you setup filters for exclusions, or perhaps a cap on how much is transferred?

  2. bob smith Says:

    Note that Unison is not compatible across different (minor) versions. This can be a headache for synching between home and work.

  3. flyingfsck Says:

    Rsync is your friend. An advantage of rsync is bandwidth control, so that it doesn’t slurp up all available capacity. Rsync works well over SSH and can therefore be used over the internet.

  4. Tom Says:

    If one site is the master, rsync is better IMO.

    However, if you want to keep your ~/bin coherent between 2 systems (work & home) where you’re editing/adding new files to either one, unison is better.

    It’s important both sides match versions. They won’t connect otherwise :-(. After you get past that hurdle, it is cross platform.

  5. Thomas Says:

    You can use unison even if you want a master copy, just force it to always replicate one way (using -force).

    rsync is great for ad-hoc stuff (no setup). unison keeps state information so it’s quicker, especially when working on large trees over slow links (it does not have to compare all the files via the link, it just sends changes and then resolves them).

    I used unison to keep my ‘downloads’ directory synchronized across 3 computers (2 desktops and a laptop shuffling between them). Never had a problem.

    Both can be tunneled through ssh.
    You could limit unison using trickle, though I’ve never done this myself.

  6. Sid Says:

    I had some problems with swedish characters åäö when using Unison. During sync it created duplicate folders/files with junk-characters instead of åäö.

    But except this, it worked like a charm.

  7. Kamil Kisiel Says:

    I’ve tried Unison multiple times.

    My biggest problems with it:

    The UI and configuration file format are pretty ugly.

    The other problem is that it’s written in OCaml, so it’s not very easy to hack on if you want to make changes.

    Other than that, I think it’s a great tool, just a bit rough around the edges.

  8. ikaruga Says:

    @Scott@ I’ve been using unison for a while now and it’s awesome. (It’s awesome because I make changes on both computers and that would throw off rsync.) It’s dead simple to setup. unison syncs two folders. Exclusions are done via “-ignore ‘Path /path’ and -’ignore ‘Name ‘. I dunno about file transfer limits though, although it might be possible.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>