Search code examples
linuxshellwso2wso2-esbwso2-enterprise-integrator

Wso2: Configuring rsync for Deployment Synchronization


I've set up a clustered deployment for 2 mi nodes and I'm trying to enable rsync(remote synchronization) using the following documentation: Rsync for wso2

I've set everything up, but when I try to run the final cron expression (*** sh * * * * /home/ubuntu/setup/rsync-for-depsync/rsync-for-ei-depsync.sh=**), I get the following error:

nodes-list.txt: 1: root@<my_server_ip1>:~/home/ubuntu/mi/wso2mi_server1-4.0.0/repository/deployment/server: not found
nodes-list.txt: 2: root@<my_server_ip2>:~/home/ubuntu/mi/wso2mi_server2-4.0.0/repository/deployment/server: not found

Solution

  • To run a cron job, you need to add it to the special file known as a crontab. Just running the command in the CLI won't work.

    Step 1: Edit your crontab with the following command. This will prompt to choose a editor to open the file.

    $ crontab -e
    

    Step 2: Add the cron expression and the command. In our case, we need to execute the rsync-for-ei-depsync.sh script every minute. To do that add the following line to the end of the crontab file you opened in the step 1.

    *   *  *   *   *  sh /home/ubuntu/setup/rsync-for-depsync/rsync-for-ei-depsync.sh
    

    For more information on Cron Jobs refer https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-ubuntu-1804