<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: unison</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/unison/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Howto | Synchronise files with Unison</title>
      <link>https://chrisjrob.com/2009/03/21/synchronise-files-with-unison/</link>
      <pubDate>Sat, 21 Mar 2009 06:22:37 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/synchronise-files-with-unison</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/unison_logo.png" align="right" alt="Featured Image">
         
         <h2 id="installing-unison">Installing Unison</h2>

<p>You need to install unison on both machines, unison-gtk probably only on the client.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install unison unison-gtk
</code></pre></div></div>

<!--more-->

<p>N.B. unison-gtk is an optional component - if you are comfortable working from the command line.</p>

<h2 id="using-unison">Using Unison</h2>

<p>Under KMenu / Utilities there should be an option for Unison File Synchronisation.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd ~
$ mkdir unison
</code></pre></div></div>

<p>A sample <code class="language-plaintext highlighter-rouge">~/.unison/default.prf</code> config file is shown here:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Unison preferences file
root = /home/user/unison
root = ssh://user@remote.server/unison
follow = Regex .*
</code></pre></div></div>

<p>This is a simple configuration which will synchronise a directory called “unison” under the user’s home directory to a users “unison” directory on “remote.server”.  If the unison directory includes symbolic links, then it will follow the link and copy the actual file, if this is not what you want, simply delete the “follow” line.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Unison File Synchronisation</title>
      <link>https://chrisjrob.com/2008/10/27/unison-file-synchronisation/</link>
      <pubDate>Mon, 27 Oct 2008 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2008/10/27/unison-file-synchronisation</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/unison_logo.png" align="right" alt="Featured Image">
         
         <p>One of the few things that we miss from the old Microsoft days is the “briefcase”.  In particular our MD used it every day and loved it.  On Linux the best open source alternative is probably Unison File Synchroniser.</p>

<p>I got this working a few weeks ago and it was incredibly simple to get working and a joy to use.  I personally didn’t really have a need for this software, but now that it’s installed it just so convenient that I am finding myself using it regularly.</p>

<!--more-->

<p>My first set-up was with my home laptop (<a href="http://www.kubuntu.org/">Kubuntu</a>) and our work server (<a href="http://www.debian.org/">Debian</a> Etch).  I simply did an <code class="language-plaintext highlighter-rouge">apt-get install unison</code> on the server and <code class="language-plaintext highlighter-rouge">apt-get install unison unison-gtk</code> on the laptop.  The gtk gui is of course optional, Unison is perfectly happy working from the command line, and it does have the benefit then of being able to automate the process to some extent.</p>

<p>On the laptop, I created a directory “unison” under my home to use as my local store and ditto on the server, so that I had <code class="language-plaintext highlighter-rouge">/home/chris/unison</code> on both home and server (they don’t have to be the same username or path).</p>

<p>I then ran Unison from the Utilities menu, which prompted me for the local dir - which I entered as <code class="language-plaintext highlighter-rouge">/home/chris/unison</code>.  It then prompted me for the remote dir, which protocol I wanted to use (I selected ssh), the hostname and user account of the server.</p>

<p>It then prompted me for my user account’s password and then warned me that the directories were both empty and that it was assuming that this was the first time I had done a synchronisation.</p>

<p>I then tested by putting a file in the local directory and running unison again, and sure enough it synced up to the server.</p>

<p>Job done.</p>

<p>Unfortunately our MD had bought himself a MacBook.  Grrr.  Fortunately <a href="http://www.cs.haifa.ac.il/%7Eshuly/unison/">Unison is available for the MacBook</a>, and it has a gorgeous GUI.  A quick install and, disaster, “fatal error” on synchronisation and an helpful warning that the client/server versions might be incompatible, but a quick <code class="language-plaintext highlighter-rouge">apt-get -t etch-backports install unison</code> resolved that problem in a trice, all now working beautifully.</p>

<p>I think there’s a Windows version as well, but no-one really runs Windows these days, so that’s probably of no interest ;-).</p>

<ul>
  <li><a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison File Synchroniser</a></li>
  <li><a href="http://www.cs.haifa.ac.il/%7Eshuly/unison/">Mac Version</a></li>
</ul>

<p>One thing that our MD likes is to have a single directory on his desktop that has links to all the files around the system that he likes to monitor daily.  The problem is that Unison will only synchronise the link, not the file itself, and of course the link won’t work remotely.</p>

<p>The solution is to edit the <code class="language-plaintext highlighter-rouge">~/.unison/default.prf</code> file and add the following line (client end only):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>follow = Regex .*
</code></pre></div></div>

<p>Unison will now follow the symbolic links (not .desktop files - only actual symbolic links) and sync the file to which they point.  (On a MacBook this <code class="language-plaintext highlighter-rouge">.prf</code> file is under <code class="language-plaintext highlighter-rouge">~/Library/Application Support/Unison</code>, or somewhere close to that anyway!)</p>

<p>Update: I have written these instructions into a simple howto:</p>

<ul>
  <li>
    <table>
      <tbody>
        <tr>
          <td>[Howto</td>
          <td>Synchronise files with Unison](/2009/03/21/synchronise-files-with-unison/)</td>
        </tr>
      </tbody>
    </table>
  </li>
</ul>


       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
