apt-get -y install unison openssh-server ssh nano
 
ssh-keygen -t dsa
 
ssh-copy-id -i $HOME/.ssh/id_dsa.pub root@192.168.0.101
 
# ssh-copy-id -i $HOME/.ssh/id_dsa.pub root@192.168.0.101
 
 
root@server2:/home/administrator# cat $HOME/.ssh/authorized_keys
 
# run interactively
unison /var/www ssh://192.168.0.101//var/www
 
# run batch configuration
nano /root/.unison/default.prf
 
# Roots of the synchronization
root = /var/www
root = ssh://192.168.0.101//var/www
 
 
## we can run Unison without any arguments:
unison
 
## syncronize every 5 minutes
crontab -e
*/5 * * * * /usr/bin/unison &> /dev/null
 
## test syncronization
echo "Test 1" > /var/www/test.txt
## should appear on server 2
## now test new file on server2