[Linux] How to use unison for synchronize files
Replication folder /tmp/srv238 (on 192.168.2.238) <-> /tmp/srv239 (on 192.168.2.239) (master-master) with user: super.
S1. Setup login ssh without password
- Create public key and private key in ssh client:
Manual start:
S1. Setup login ssh without password
- Create public key and private key in ssh client:
ssh-keygen -t dsa- Copy public key from client to ssh server:
ssh-copy-id -i ~/.ssh/id_dsa super@webserver2S2. Config file Unison, auto answer request
sudo nano /home/super/.unison/default.prfEdit file
root = /tmp/server238S3. Start
root = ssh://192.168.2.239//tmp/server239
auto=true
batch=true
Manual start:
unison defaultAuto start every 1 minute:
crontab -eand add line:
1 * * * * unison defaultS4. Log
tail -f /home/super/.ssh/unison.log