![]() Type the following command for incron installation: sudo apt-get install incronĬonfigure the /etc/incron.allow file in order to allow user to use incron: sudo nano /etc/incron. add a new file, delete a file etc) and executes the command or scripts.It's usage is generally similar to cron. Make the unison to run every 30 min automatically: */30 * * * * unison -batch /var/How To Call unison On Demand?įor this, we need to install the incron(inotify cron daemon) which monitors filesystem events (e.g. Run unison again on PrimarySrv for sync: unison -batch /var/Verify the synchronization status on PrimarySrv:Įdit the crontab file to make the sychronization process automatically: crontab -e It allows two replicas of a collection of files to be stored on different hosts (or different disks on the same host), modified separately. Use this command to verify that the local unison client can start and connect to the remote server(In this case,remote server's ip address is 192.168.1.203): unison -testServer /var/Now, try to sync with the remote server with the -batch (batch mode) option ask no questions at all: unison -batch /var/Create a sample file inside the /var/Verify the /var/www/ directory on SecondarySrv:įor two-way synchronization verification, create a file on SecondarySrv with the name " server2" inside the /var/www/ directory: sudo touch server2 Unison is a file-sync tool for OSX, Unix, and Windows. Unison is a file-synchronization tool for Unix and Windows. Now, issue this command for the installation of unison on both server: sudo apt-get install unison Now,try to connect to SecondarySrv from PrimarySrv, and this time, it will not ask for the password ssh ssh directory with 700 permissions and try to append the public key to authorized_keys once again: ssh directory for this user (this user has never used ssh before). We got an error saying " ~/.ssh/authorized_keys: No such file or directory" it means that there is no. This tutorial shows how to set up file synchronization between two Ubuntu 12.04 servers with Unison that are on the same network but you can use the same approach on the servers that are not placed on the same network.īefore installing the unison,generate the ssh key pair on PrimarySrv and copy the public key to the SecondarySrv: ssh-keygen scp ~/.ssh/id_rsa.pub :Ĭonnect to the SecondarySrv, append the public key to authorized_keys: cat id_rsa.pub > ~/.ssh/authorized_keys It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other. Unison is a file-synchronization tool for Unix and Windows. File Synchronization Between Two Ubuntu Servers using Unison
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |