<?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>digital playground</title>
	<atom:link href="http://www.digitalplayground.at/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.digitalplayground.at</link>
	<description>Unternehmenshomepage Digitalplayground</description>
	<lastBuildDate>Tue, 31 Jan 2012 05:07:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Another Dropbox alternative &#8211; somewhat</title>
		<link>http://www.digitalplayground.at/?p=1</link>
		<comments>http://www.digitalplayground.at/?p=1#comments</comments>
		<pubDate>Fri, 20 May 2011 04:49:35 +0000</pubDate>
		<dc:creator>Thomas Brandstetter</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[dropbox alternative unison]]></category>

		<guid isPermaLink="false">http://www.digitalplayground.at/?p=1</guid>
		<description><![CDATA[Call me paranoid, but I like to have my data on my own server. Because of that, I tried to find an alternative to Dropbox which allows me to sync my private data with my private server. I came across some blog postings, which you can read here or here and of course here. First [...]]]></description>
			<content:encoded><![CDATA[<p>Call me paranoid, but I like to have my data on my own server. Because of that, I tried to find an alternative to Dropbox which allows me to sync my private data with my private server.</p>
<p>I came across some blog postings, which you can read <a title="Coming soon: an open source Dropbox alternative with collaboration" href="http://downloadsquad.switched.com/2010/06/11/sparkleshare-open-source-dropbox/" target="_blank">here</a> or <a title="HOWTO build your own open source Dropbox clone" href="http://fak3r.com/geek/howto-build-your-own-open-source-dropbox-clone/" target="_blank">here</a> and of course <a title="Dropbox Clone Ubuntu One" href="http://www.linux-magazine.com/Online/News/Dropbox-Clone-Ubuntu-One" target="_blank">here</a>. First of all, I took a look at lipsync which depends on lsyncd to synchronise your folders. Furthermore, the support for OSX with lsyncd is <a title="Apple OS X 10.5/10.6 Lsyncd support" href="http://groups.google.com/group/lsyncd/browse_thread/thread/7795dcb982956e24" target="_blank">experimental</a>. I tried this solution and it also worked for me, but it was a pain to get all the things and dependencies together. To make a long story short, it is too complicated for a small and simple Dropbox alternative.</p>
<p>The second candidate I tried was <a title="Sparkleshare" href="http://sparkleshare.org/" target="_blank">Sparkleshare</a>. It&#8217;s relatively new (0.2RC1) and didn&#8217;t work for me. I tried to use my own git repository and always had big performance problems (high load on my MacPro) as I tried to initially load my documents to the server.</p>
<p>Ubuntu One = Linux client only. This brings me to the end of this story. Right now there is no way to automatically sync your data.</p>
<p>Ha, that&#8217;s not quite right. It took me a while to find exactly the tool I was looking for, but I&#8217;ve found it. It&#8217;s called Unison and is a sync tool I used before to get my data synchronized. What is new, that the Unison developers are working on an automatic syncing possibility like Dropbox. In the next steps I&#8217;ll show you how to create a bi-directional automatic Dropbox (somewhat) alternative. This method should also work in a multi-client setup with different operating systems (OSX, Linux, Windows). I&#8217;ve tested this under a OSX (Client)/Linux(Server) environment.</p>
<p><strong>1. Get Objective CAML (needed to build Unison)</strong></p>
<p>You can get the latest version (prebuild for OSX) <a title="Ocaml for OSX prebuild" href="http://caml.inria.fr/pub/distrib/ocaml-3.12/ocaml-3.12.0-intel.dmg">here</a></p>
<p><strong>2. Build Unison from SVN (474)</strong></p>
<p><strong> </strong>The latest svn version for Unison is 474. You need this version, because it has the newest version of fsmonitor.py and the &#8220;repeat watcher&#8221; feature that we need for this solution.</p>
<blockquote><p><em>svn checkout https://webdav.seas.upenn.edu/svn/unison</em><br />
<em>cd  unison/trunk/src &amp;&amp; make NATIVE=yes UISTYLE=text</em><br />
<em>chmod 755 unison &amp;&amp; sudo cp unison /usr/local/sbin/</em></p>
<p><em>chmod 755 fsmonitor.py &amp;&amp; sudo cp fsmonitor.py /usr/local/bin/</em></p></blockquote>
<p>It is absolutely vital to install the same version of Unison on the server as well on the client to get it running! Furthermore you should have python on your server to get the fsmonitor.py script running, which will be called from Unison on startup.</p>
<p><strong>3. Create a Unison profile for your sync folder</strong></p>
<p>A full documentation of Unison parameters and tweaks can be found <a title="Unison manual" href="http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html" target="_blank">here</a>. You can create a file &#8220;yourprofilename.prf&#8221; under $HOME/.unison (if the directory doesn&#8217;t exist, just create it). My personal profile looks like this:</p>
<blockquote>
<p class="code"><em># Unison preferences</em></p>
<p class="code"><em>fileroot = /Users/digitalplayground/Documents</em></p>
<p class="code"><em>root =  ssh://dp@my.remote.net:2222//storage/data/documents</em></p>
<p class="code"><em>perms = 0</em></p>
<p class="code"><em>servercmd=/usr/local/sbin/unison</em></p>
<p class="code"><em>ignore = Name .DS_Store</em></p>
<p class="code"><em>ignore = Name *~</em></p>
<p class="code"><em>ignore = Name .*~</em></p>
<p class="code"><em>ignore = Name ._*</em></p>
<p class="code"><em>ignore = Name .localized</em></p>
</blockquote>
<p><strong>4. Run Unison</strong></p>
<p>Ok, so now we are ready to run Unison for the first time with the following command:</p>
<blockquote>
<p class="code">unison yourprofilename -repeat watch</p>
</blockquote>
<p>So, what makes the SVN version of Unison different? First of all, you have the new &#8220;-repeat watch&#8221; feature which will utilize fsmonitor.py. The fsmonitor.py python script uses the filesystem monitoring features of OSX, Linux and Windows to check if there are any changes on any files or directories within your server or client document path (which you configured in the profile). The repeat option let Unison run in daemon mode, so that it can automatically sync changes to the other host. This ensures that only the changed files will be synced and that it runs as it happens. This is a big change to the existing cronjob method. One caveat right now is that Unison doesn&#8217;t stop the processes on the server, when we kill the processes on the client. You have to do that manually.</p>
<p><strong>5. Advanced steps (right now only for OSX)</strong></p>
<p>My main purpose was to get things automatically done. Luckily, there are tools on OSX which helps me to achieve that. For this method, it is crucial to use private/public key authentication with SSH.<strong><br />
</strong></p>
<p><strong>5.1 Automatic stop/start depending on the network connection</strong></p>
<p>I&#8217;m using this method mainly on my laptop which doesn&#8217;t have a network connection all the time. This said, I had to think about a way to get Unison started, when there is a connection and stopped if the connection goes away. One tool to do that is <a title="Pymacadmin tools - Crankd" href="http://pymacadmin.googlecode.com/hg/bin/crankd.py" target="_blank">crankd</a>. Crankd monitors your Mac&#8217; network connection and runs a defined script. The configuration of crankd is very easy</p>
<ul>
<li>Put the python script to /usr/local/sbin</li>
<li>Create a LaunchScript for crankd ($HOME/Library/LaunchAgents/org.crankd.plist):</li>
</ul>
<blockquote>
<p class="code"><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</em></p>
<p class="code"><em>&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;</em></p>
<p class="code"><em>&lt;plist version=&#8221;1.0&#8243;&gt;</em></p>
<p class="code"><em>&lt;dict&gt;</em></p>
<p class="code"><em>&lt;key&gt;KeepAlive&lt;/key&gt;</em></p>
<p class="code"><em>&lt;true/&gt;</em></p>
<p class="code"><em>&lt;key&gt;Label&lt;/key&gt;</em></p>
<p class="code"><em>&lt;string&gt;org.crankd.plist&lt;/string&gt;</em></p>
<p class="code"><em>&lt;key&gt;ProgramArguments&lt;/key&gt;</em></p>
<p class="code"><em>&lt;array&gt;&lt;string&gt;/usr/local/sbin/crankd.py&lt;/string&gt;&lt;/array&gt;</em></p>
<p class="code"><em>&lt;key&gt;RunAtLoad&lt;/key&gt;</em></p>
<p class="code"><em>&lt;true/&gt;</em></p>
<p class="code"><em>&lt;/dict&gt;</em></p>
<p class="code"><em>&lt;/plist&gt;</em></p>
</blockquote>
<ul>
<li>Create a configuration plist file for crankd ($HOME/Library/Preferences/com.googlecode.pymacadmin.crankd.plist):</li>
</ul>
<blockquote>
<p class="code"><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</em></p>
<p class="code"><em>&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple Computer//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;</em></p>
<p class="code"><em>&lt;plist version=&#8221;1.0&#8243;&gt;</em></p>
<p class="code"><em>&lt;dict&gt;</em></p>
<p class="code"><em>&lt;key&gt;SystemConfiguration&lt;/key&gt;</em></p>
<p class="code"><em>&lt;dict&gt;</em></p>
<p class="code"><em>&lt;key&gt;State:/Network/Global/IPv4&lt;/key&gt;</em></p>
<p class="code"><em>&lt;dict&gt;</em></p>
<p class="code"><em>&lt;key&gt;command&lt;/key&gt;</em></p>
<p class="code"><em>&lt;string&gt;/usr/local/sbin/unisync&lt;/string&gt;</em></p>
<p class="code"><em>&lt;/dict&gt;</em></p>
<p class="code"><em>&lt;/dict&gt;</em></p>
<p class="code"><em>&lt;/dict&gt;</em></p>
<p class="code"><em>&lt;/plist&gt;</em></p>
</blockquote>
<p>Last but not least you need the unisync script which will to all the magic for you. You can find the latest version <a title="Unisync download" href="http://www.digitalplayground.at/downloads/unisync" target="_blank">here</a>. From your home directory on the client, launch crankd with:</p>
<blockquote>
<p class="code"><em>launchctl load Library/LaunchAgents/org.crankd.plist</em></p>
</blockquote>
<p><strong><strong>5.2 Get notified on a change</strong></strong></p>
<p>Personally, I like to know what&#8217;s going on in the background, so I wrote a notifier script which utilizes Growl. Furthermore, the script gets called by the launchd feature called &#8220;watchpaths&#8221;, which only gets triggered if the file unison.log changes (every time on a filechange if you didn&#8217;t disable it through the Unison preferences).  If you don&#8217;t have Growl already, you can download it <a title="Growl" href="http://growl.info/" target="_blank">here</a>. Additionally, you need the command line utility growlnotify. You can find it in the &#8216;Extras&#8217; folder of the Growl disk image. Just put the binary under /usr/local/bin. Having Growl in place you can begin to configure your system to notify you in case of file changes. Again, create a launch item under $HOME/Library/LaunchAgents and call it at.digitalplayground.unison.notifier.plist. The content should look like this:</p>
<blockquote>
<p class="code"><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</em></p>
<p class="code"><em>&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;</em></p>
<p class="code"><em>&lt;plist version=&#8221;1.0&#8243;&gt;</em></p>
<p class="code"><em>&lt;dict&gt; </em></p>
<p class="code"><em>&lt;key&gt;Label&lt;/key&gt;</em></p>
<p class="code"><em> </em><em>&lt;string&gt;at.digitalplayground.unison.notifier&lt;/string&gt;</em></p>
<p class="code"><em>&lt;key&gt;ProgramArguments&lt;/key&gt;</em></p>
<p class="code"><em>&lt;array&gt;&lt;string&gt;/usr/local/bin/unisync_notifier&lt;/string&gt;&lt;/array&gt;</em></p>
<p class="code"><em>&lt;key&gt;WatchPaths&lt;/key&gt;</em></p>
<p class="code"><em>&lt;array&gt; </em></p>
<p class="code"><em> </em><em>&lt;string&gt;/Users/youruser/unison.log&lt;/string&gt;</em></p>
<p class="code"><em>&lt;/array&gt;</em></p>
<p class="code"><em>&lt;/dict&gt;</em></p>
<p class="code"><em>&lt;/plist&gt;</em></p>
</blockquote>
<p>Next, create the unisync_notifier script, which will be placed under /usr/local/bin:</p>
<blockquote>
<p class="code"><em>#!/bin/sh</em></p>
<p class="code"><em>tail -n1 $HOME/unison.log|/usr/local/bin/growlnotify -a Unison</em></p>
</blockquote>
<p>Finally, you have to launch the agent again (from your home directory) with:</p>
<blockquote>
<p class="code"><em>launchctl load Library/LaunchAgents/at.digitalplayground.unison.notifier.plist</em></p>
</blockquote>
<p>That&#8217;s it. Now everything should run automatically and in the background. Maybe someone is interested in writing a cocoa/apple-script application with a menu item and native notification?</p>
<p><strong>Update 11/07/26: </strong>Lyle Gordon created an Unison backend for Sparkleshare, which looks quite promising. You can find it <a title="LGordon Git repository" href="https://github.com/lgordon/SparkleShare" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalplayground.at/?feed=rss2&#038;p=1</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

