<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Yet another web log &#187; Synchronization</title>
	<atom:link href="http://blog.philippheckel.com/tag/synchronization/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.philippheckel.com</link>
	<description>Life, Linux and other things</description>
	<lastBuildDate>Tue, 24 Aug 2010 05:24:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Unison &amp; multiple hosts: &#8220;Warning: inconsistent state.&#8221;</title>
		<link>http://blog.philippheckel.com/2008/10/25/unison-and-multiple-hosts-warning-inconsistent-state/</link>
		<comments>http://blog.philippheckel.com/2008/10/25/unison-and-multiple-hosts-warning-inconsistent-state/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 16:18:34 +0000</pubDate>
		<dc:creator>Philipp C. Heckel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Synchronization]]></category>
		<category><![CDATA[Unison]]></category>

		<guid isPermaLink="false">http://blog.philippheckel.com/2008/10/25/unison-and-multiple-hosts-warning-inconsistent-state/</guid>
		<description><![CDATA[As some of you might know, Unison is this great tool that allows bidirectional synchronisation of two hosts, &#8211; no matter which operating system they&#8217;re running&#8230; Well, at least the well known ones are supported. Since Unison can also be used to sychronise more than two hosts, it&#8217;s perfect for big amounts of data that [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you might know, <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a> is this great tool that allows bidirectional synchronisation of two hosts, &#8211; no matter which operating system they&#8217;re running&#8230; Well, at least the well known ones are supported.</p>
<p>Since Unison can also be used to sychronise more than two hosts, it&#8217;s perfect for big amounts of data that has to be shared in a team. </p>
<p>A scenario like this is possible and works for me: UserA &lt;-&gt; Server &lt;-&gt; UserB.<br />
But of course, also other users could sync with the server. Unison rocks!</p>
<p>Today, after reinstalling his OS, my friend got the following error message:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Warning: inconsistent state.  
The archive file is missing on some hosts.
For safety, the remaining copies should be deleted.
  Archive are96968da50882488164ef52510703a8e on 
     host &amp;lt;UserAs-local-hostname&amp;gt; is MISSING
  Archive ar664775fc717afcf6cc46edbc47d25641 on ...</pre></div></div>

<p><span id="more-15"></span></p>
<h3 id="toc-the-easy-solution">The easy solution</h3>
<p>Unison keeps archive-files for each pair it synchronises with. One on each host, i.e. one on your local PC (UserA) and one on the server, both stored in a folder called <em>~/.unison</em> and looking like the files above.</p>
<p>The easiest solution would be to just <strong>delete all archive-files</strong> on the server as unison suggests. <strong>But</strong> that would result in a situation where all the other users that sync their files with the server would have to do a slow sync which is <em>extremely slow</em> and sometimes takes more than 20 minutes for large folders (e.g. > 10 GB).</p>
<h3 id="toc-the-best-solution">The best solution &#8230;</h3>
<p>&#8230; is to just delete the required archive-files on the server. Pretty easy, that&#8217;s how it works:</p>
<p>Log on to the server (assuming that it&#8217;s a Linux machine, but it certainly works similar for any other system) and find the relevant archive files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> mysyncuser<span style="color: #000000; font-weight: bold;">@</span>mysyncserver.com
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.unison
$ <span style="color: #c20cb9; font-weight: bold;">fgrep</span> <span style="color: #ff0000;">'//UserAs-local-hostname/'</span> <span style="color: #c20cb9; font-weight: bold;">ar</span><span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>You should get something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Binary file ar664775fc717afcf6cc46edbc47d25641 matches</pre></div></div>

<p>Delete the listed files and it should work like a charm. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippheckel.com/2008/10/25/unison-and-multiple-hosts-warning-inconsistent-state/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GCALDaemon deb-package for Ubuntu/Kubuntu</title>
		<link>http://blog.philippheckel.com/2008/09/30/gcaldaemon-deb-package-for-ubuntu-kubuntu/</link>
		<comments>http://blog.philippheckel.com/2008/09/30/gcaldaemon-deb-package-for-ubuntu-kubuntu/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 16:50:38 +0000</pubDate>
		<dc:creator>Philipp C. Heckel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Synchronization]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Kubuntu]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.philippheckel.com/2008/09/30/gcaldaemon-deb-package-for-ubuntu-kubuntu/</guid>
		<description><![CDATA[GCALDaemon is a great tool to synchronise many of Google&#8217;s services such as Google Calendar and Contacts with your local PC. Unfortunately, the installation on Ubuntu/Kubuntu and any other Linux distribution is still not the most comfortable. For this reason, I sat down some hours and packed the tool into a deb-package and additionally added [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gcaldaemon.sourceforge.net/">GCALDaemon</a> is a great tool to synchronise many of Google&#8217;s services such as Google Calendar and Contacts with your local PC. </p>
<p>Unfortunately, the installation on Ubuntu/Kubuntu and any other Linux distribution is still not the most comfortable. For this reason, I sat down some hours and packed the tool into a <strong>deb-package</strong> and additionally added a nice command line tool to simplify some of the basics.</p>
<p><span id="more-12"></span></p>
<p>For those who can&#8217;t wait, here&#8217;s the package: <a href="/uploads/2008/09/gcaldaemon_1.0beta16~ubuntu0_all.deb">gcaldaemon_1.0beta16~ubuntu0_all.deb</a></p>
<p><strong>Update Nov/08: Ubuntu Intrepid</strong>: I just re-installed my Ubuntu and successfully tested the provided version for the new system. Works like a charm for Hardy and for Intrepid.<br />
~ 150 downloads so far, no complains/malfunctions!</p>
<p><strong>Update Feb/09: Launchpad</strong>: I just uploaded the code that creates the deb-package on <a href="https://code.launchpad.net/~binwiederhier/+junk/gcaldaemon">Launchpad</a>. Maybe somebody of the Ubuntu team will pick it up and integrate it into the distribution. There is also a <a href="https://bugs.launchpad.net/ubuntu/+bug/305446">bug report</a> for this issue, &#8211; feel free to contribute. </p>
<p>For all of you interested how to create your own package from my sources, follow these steps:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ bzr branch <span style="color: #c20cb9; font-weight: bold;">lp</span>:~binwiederhier<span style="color: #000000; font-weight: bold;">/</span>+junk<span style="color: #000000; font-weight: bold;">/</span>gcaldaemon
$ <span style="color: #7a0874; font-weight: bold;">cd</span> gcaldaemon
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>gcaldaemon<span style="color: #000000; font-weight: bold;">/</span>gcaldaemon-linux-<span style="color: #000000;">1.0</span>-beta16.zip
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>create-package.sh gcaldaemon-linux-<span style="color: #000000;">1.0</span>-beta16.zip <span style="color: #ff0000;">'gcaldaemon_1.0beta16~ubuntu0_all.deb'</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> gcaldaemon_1.0beta16~ubuntu0_all.deb</pre></div></div>

<p><strong>Update Apr/09: Ubuntu 9.04, Jaunty Jackalope</strong>: As <a href="#comment-4872">Jens</a> just wrote in the comments-section, the deb-package seems to work for Jaunty as well without complications. Yeyy!</p>
<h3 id="toc-download-and-install">Download and install</h3>
<p>Alternatively to creating the package from my source, you can just download and install it from my deb-file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>blog.philippheckel.com<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2008</span><span style="color: #000000; font-weight: bold;">/</span>09<span style="color: #000000; font-weight: bold;">/</span>gcaldaemon_1.0beta16~ubuntu0_all.deb
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> gcaldaemon_1.0beta16~ubuntu0_all.deb</pre></div></div>

<p>The following tools will be available:</p>
<ul>
<li><strong>gcaldaemon</strong><br />Start/stop/restart the daemon.</li>
<li><strong>gcaldaemon-sync-now</strong><br />For immediate synchronization.</li>
<li><strong>gcaldaemon-config</strong><br />Open the graphical config editor.<br />Also available via the menu &bdquo;Utilities -> Configure GCALDaemon&rdquo;.</li>
<li><strong>gcaldaemon-password-encoder</strong><br />Encode passwords for the config file.</li>
</ul>
<h3 id="toc-configuration">Configuration</h3>
<p>Each user of the system can have his or her own instance of the daemon running.<br />
The config file is located at <strong>~/.gcaldaemon/conf/gcal-daemon.cfg</strong>.</p>
<p>To edit the config file, you can either use your favorite editor, e.g. <em>vi</em> or use the GCALDaemon config editor GUI:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gcaldaemon-config</pre></div></div>

<p>You can also open the config editor via the menu:  &bdquo;Utilities -&gt; Configure GCALDaemon&rdquo;.</p>
<p>To create passwords for the config file use the <em>gcaldaemon-password-encoder</em>-script. For details about the config options, please read the <a href="http://gcaldaemon.sourceforge.net/usage.html">GCALDaemon documentation</a>.</p>
<h3 id="toc-running-gcaldaemon">Running GCALDaemon</h3>
<p>I have simplified the way how to start/stop the daemon with a small script. Simply type &#8220;gcaldaemon&#8221; to see what it can do. </p>
<p>To start, restart, stop and check the status (just like in an init-script), type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gcaldaemon start
Starting GCALDaemon ... ok
&nbsp;
$ gcaldaemon status
GCALDaemon is running <span style="color: #c20cb9; font-weight: bold;">as</span> PID 30543.
&nbsp;
$ gcaldaemon restart
Stopping GCALDaemon ... ok
Starting GCALDaemon ... ok
&nbsp;
$ gcaldaemon stop
Stopping GCALDaemon ... ok</pre></div></div>

<h3 id="toc-enable-autostart-for-gcaldaemon">Enable autostart for GCALDaemon</h3>
<p>To enable the autostart-option for GNOME or KDE, type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gcaldaemon <span style="color: #7a0874; font-weight: bold;">enable</span> kde
$ gcaldaemon <span style="color: #7a0874; font-weight: bold;">enable</span> kde4
$ gcaldaemon <span style="color: #7a0874; font-weight: bold;">enable</span> gnome</pre></div></div>

<p>As a GNOME user, it&#8217;s also possible to enable/disable the daemon autostart via the menu &bdquo;System -&gt; Settings -&gt; Sessions&rdquo;</p>
<h2>Finally &#8230;</h3>
<p>I know that the package is far from perfect, but it&#8217;s a lot easier to install/configure than the original package. Feedback is always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippheckel.com/2008/09/30/gcaldaemon-deb-package-for-ubuntu-kubuntu/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Unison 2.27.57 on Debian Etch and Ubuntu Hardy</title>
		<link>http://blog.philippheckel.com/2008/05/16/unison-2-27-57-on-debian-etch-and-ubuntu-hardy/</link>
		<comments>http://blog.philippheckel.com/2008/05/16/unison-2-27-57-on-debian-etch-and-ubuntu-hardy/#comments</comments>
		<pubDate>Fri, 16 May 2008 00:47:32 +0000</pubDate>
		<dc:creator>Philipp C. Heckel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Synchronization]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unison]]></category>

		<guid isPermaLink="false">http://blog.philippheckel.com/2008/05/16/unison-22757-on-debian-etch-and-ubuntu-hardy/</guid>
		<description><![CDATA[The good thing about the file sync tool Unison is, that it&#8217;s available for several operating systems. This is great for groups working on different systems (Mac, Linux and Windows) but want to share and synchronize files on a remote server. Well, the bad thing about Unison on the other hand is, that its backwards [...]]]></description>
			<content:encoded><![CDATA[<p>The good thing about the file sync tool <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a> is, that it&#8217;s available for several operating systems. This is great for groups working on different systems (Mac, Linux and Windows) but want to share and synchronize files on a remote server.</p>
<p>Well, the bad thing about Unison on the other hand is, that its backwards compatibility is anything but great, so that you have to make sure that everybody in the team uses the same version. And this can be tricky depending on what system you are using.</p>
<p>My home system is Ubuntu Hardy, the remote server system is Debian Etch. Both come with Unison 2.16.13 which would be great if not Apple&#8217;s new Leopard brings the newest version 2.27.57. Long story short, I needed the newest version on Hardy and Etch.</p>
<p><span id="more-3"></span></p>
<h3 id="toc-unison-on-hardy">Unison on Hardy</h3>
<p>To install the newest version of Unison on Hardy, it&#8217;s the best to just use the existing Backport package.</p>
<p>First, add the backports to the apt-sources, using your favorite editor, e.g. vi or nano:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> editor <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list</pre></div></div>

<p>Look for <em>backports</em> and uncomment/add the following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="apt_sources" style="font-family:monospace;"><span style="color: #00007f;">deb</span> <span style="color: #009900;">http://de.archive.ubuntu.com/ubuntu/</span> <span style="color: #b1b100;">hardy-backports</span> <span style="color: #b16000;">main</span> <span style="color: #b16000;">restricted</span> <span style="color: #b16000;">universe</span> <span style="color: #b16000;">multiverse</span>
<span style="color: #00007f;">deb-src</span> <span style="color: #009900;">http://de.archive.ubuntu.com/ubuntu/</span> <span style="color: #b1b100;">hardy-backports</span> <span style="color: #b16000;">main</span> <span style="color: #b16000;">restricted</span> <span style="color: #b16000;">universe</span> <span style="color: #b16000;">multiverse</span></pre></div></div>

<p>Then just install the backport using <em>apt-get</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> hardy-backports <span style="color: #c20cb9; font-weight: bold;">install</span> unison</pre></div></div>

<p>After installing you probably should remove the added lines from the <em>sources.list</em>-file. Otherwise the update-manager wants to install all available backports which is probably not what you want.</p>
<h3 id="toc-debian-etch">Debian Etch</h3>
<p><strong>Update 30/07/08:</strong> Before reading my post, please have a look at the much easier method described by <a href="#comment-3">Andrew</a> in the user comments. Only if this doesn&#8217;t work, you might want to have a look at my post.</p>
<p><strong>Unison 2.27.57 binary for Debian Etch</strong>:<br />
If you don&#8217;t want to compile the binary on your own (as described in the following paragraphs), you can download the <a href="/uploads/2008/05/unison-2.27.57-binary-for-debian-etch.gz">Unison 2.27.57 binary for Debian Etch</a> here.</p>
<p><strong>Update 30/11/08:</strong><br />
~ 300 downloads so far, no known problems/malfunctions!</p>
<p>It&#8217;s much more difficult on an Etch system because no Backport package is available. Therefore you either have to create such a package, which can be annoying and frustrating, or you just <em>compile it on your own and overwrite the binary</em>.</p>
<p>Add the unstable sources and the etch backports to your apt-get sources by editing the file <em>/etc/apt/sources.list</em> (as <em>root</em>!):</p>

<div class="wp_syntax"><div class="code"><pre class="apt_sources" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Unstable source packages</span>
<span style="color: #00007f;">deb-src</span> <span style="color: #009900;">ftp://ftp.de.debian.org/debian/</span> <span style="color: #b1b100;">unstable</span> <span style="color: #b16000;">main</span> <span style="color: #b16000;">contrib</span> <span style="color: #b16000;">non-free</span>
&nbsp;
<span style="color: #adadad; font-style: italic;"># Backports for Etch</span>
<span style="color: #00007f;">deb</span> <span style="color: #009900;">http://www.backports.org/debian</span> etch-backports <span style="color: #b16000;">main</span> <span style="color: #b16000;">contrib</span> <span style="color: #b16000;">non-free</span></pre></div></div>

<p>Now update <em>apt</em> and install the backport package of ocaml compiler. You also might want to install the debian backports keyring to avoid warning and error messages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> debian-backports-keyring
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> etch-backports <span style="color: #c20cb9; font-weight: bold;">install</span> ocaml</pre></div></div>

<p>Then get the source package of unison 2.27.57 and make the binary:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #7a0874; font-weight: bold;">source</span> unison
$ dpkg-source <span style="color: #660033;">-x</span> unison_2.27.57-1.dsc
$ <span style="color: #7a0874; font-weight: bold;">cd</span> unison-2.27.57<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p><em>Note:</em> For my Etch installation, the make progress failed with some error, but the binary was created successfully anyway. Just have a look whether the <em>unison</em>-binary exists and test if it is working.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>unison <span style="color: #660033;">-version</span>
unison version 2.27.57</pre></div></div>

<p>Now install the old version of Unison and replace the binary with the new one. Also you might want to remove the lines from <em>/etc/apt/sources.list</em> and uninstall the ocaml compiler.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> unison
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> unison <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
$ unison <span style="color: #660033;">-version</span>
unison version 2.27.57</pre></div></div>

<p>That&#8217;s it! I know that this is not the best solution and that it might be better to create the backports package. But as there are many dependencies to other packages it&#8217;s maybe one of the fastest solutions.</p>
<p>I decided to publish the binary here (for the lazy ones): <a href="/uploads/2008/05/unison-2.27.57-binary-for-debian-etch.gz">Unison 2.27.57 binary for Debian Etch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippheckel.com/2008/05/16/unison-2-27-57-on-debian-etch-and-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
