
* Install Unison Package in both server :
apt-get install unison openssh-server ssh
* Create a private/public key pair on server A :
ssh-keygen -t dsa
# Enter All
* Activate root :
sudo passwd root
* Copy SSH ID to the server B :
ssh-copy-id -i $HOME/.ssh/id_dsa.pub root@Ip_Address
# authorized_keys file have added to /root/.ssh/authorized_keys
* Run Unison for the first time to synchronize :
unison /var/www/ ssh://ip_address_server_B//var/www/
# Enter All if we want to copy all files and folders
* Setting Unison Script vi /root/.unison/default.prf :
# Unison preferences file
# Roots of the synchronization
root = /fileserver02/data/
root = ssh://10.10.10.8//fileserver01/data/
auto=true
batch=true
confirmbigdel=true
fastcheck=true
group=true
owner=true
prefer=newer
silent=true
times=true
* Unison Options :
man unison
* Run Unison :
unison
* Automate synchronization with cron job :
crontab -e
# Script :
*/5 * * * * /usr/bin/unison &> /dev/null
# It would run Unison every 5 minutes.
* To find out where is the Unison type :
which unison
Merasa terbantu oleh artikel atau tutorial dalam blog ini? Thank you for your donation.. ^^
© 1988 - 2016 E-NALDI Personal Website. Please add me : |
|