Set up Unison for Two Way Syncing on 2 Centos Servers

Have been played with both Async and Unison, I found Unison is more powerful, especially on 2 way syncing include deletion. Unison is easy to get start as well.

You can setup Unison by compiling the source, but it is not as easy as I thought – I ran into some libraries dependency conflicts.

Luckily, I am working on Centos servers. I can just use Yum to install it.

Enable Fedora EPEL repos for your Yum with protectbase

rpm -Uvh epel-release-5-4.noarch.rpm
yum install yum-protectbase.noarch -y
yum repolist

Install Unison via Yum

yum install unison -y

Enable SSH Access without Password

On local host, do these:

#followed by three ENTERs
ssh-copy-id -i .ssh/ root@remotehost
ssh root@remotehost

Sample Unison Command

/usr/bin/unison /web/live1 ssh://remoteserver/web/live2 \
-ignore "Path WEB-INF/config" \
-ignore "Path WEB-INF/derby" \
-ignore "Path WEB-INF/test/test.xml"


HowTo Use unison File Synchronizer
3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id