Wednesday, January 16, 2013

Use unison to synchronize directories between two apple computers

I have a mac server  x.spelman.edu (Mountain Lion). I installed unison in /opt/local/bin/unison by download the mac GUI Universal Binary 2.27.72, tested on Leopard.  (Later, I reinstalled to 2.32).

I then install the unison with GUI on my Snow Leopard laptop.  I set up a small test directory /Users/hongqin/demo/unison/. I 'touched' a file 'hello.ace.txt' in this directory. On my snow leopard, I double-clicked the "U" icon, set up a profile:
Profile name: test ace->tower
First root: File: /Users/hongqin/demo/unison/
Second root: Remote, User: YYY, Host: x.spelman.edu

After save this profile, I "open" it. Password was asked for the remote server.
10:14, looking for changes, waiting for changes from server. This seems to be stuck.

$ unison -version # 2.32
$ ssh username@x.spelman.edu unison -version #2.27
OK, unison have different version on the two computers.

Reinstall 2.32 on the server side, but the /opt/local/bin/unison was not updated automatically. I have to manually cp a 2.32 unison to the server directory.

On 'ace'
$ unison demo/unison/  ssh://xx@xx.spelman.edu/demo/unison
This worked.

I then tried
$ unison projects  ssh://xx@xx.spelman.edu/projects

During the run of unison, I tried to run a GUI version for another job, but the server did not respond. It seems there is only one instance of unison running on the server side. Not sure whether this is my configuration problem or just the way it is.

Updated on 2013 Feb 12:
The ssh method often drops when working on large number of files. Later, I mounted the remote disks locally, and run unison locally. This method seems more reliable than ssh.


The unison log file 'unison.log' is often located in user's home directory.

Note: 'unison' developer has stopped working on it. It is time for a new software tool.

Updated on June 24, 2015
https://en.wikipedia.org/wiki/Unison_(file_synchronizer)#Advice_on_using_Unison

https://en.wikipedia.org/wiki/Comparison_of_file_synchronization_software

No comments:

Post a Comment