Sample Header Ad - 728x90

rsync script work on CentOS 7, same script doesn't work on RHEL 7

0 votes
1 answer
207 views
I have a VM cluster with 3 nodes on CentOS7 and one node on RHEL7. There is a directory where rsync is enabled
/mnt//portal/wso2telcohub-3.0.2/repository/deployment/server/synapse-configs/default/api/
incrontab is set as below.
$ incrontab -l
/mnt//portal/wso2telcohub-3.0.2/repository/deployment/server/synapse-configs/default/api/ IN_MODIFY,IN_ATTRIB,IN_CREATE,IN_DELETE /mnt/rsync/rsync-for-carbon-depsync.sh
rsync script with debug enabled
#!/bin/sh -ex
#source folder
portal=/mnt//portal/wso2telcohub-3.0.2/repository/deployment/server/synapse-configs/default/
#Destination folder
gateway=/mnt//gateway/wso2telcohub-3.0.2/repository/deployment/server/synapse-configs/default
LOG=/log/rsync/carbon-rsync-logs/"log-local-$(date +%Y%m%d_%H%M%S).log"

echo "entered the script" >> $LOG

#keep a lock to stop parallel runs
(
echo "entered the flock" >> $LOG
flock -e 10
echo "Obtained the lock" >> $LOG
echo " ========== $(date -Iseconds) Lock acquired by local thread > $LOG
rsync --delete -arv $portal   $gateway  >>  $LOG
) 10> /var/rsync/.rsync.lock
echo " ========== $(date -Iseconds) Release Lock acquired by local thread  =========== " >> $LOG
Below is the log file
entered the script
entered the script
Basically, whatever the change done on
should reflect on
. I created a temp file in
directory. But it doesn't reflect in
directory. This is only for the new RHEL 7 VM. Old CentOS 7 VM works fine with same script.
Asked by Pradeep Sanjeewa (207 rep)
May 6, 2020, 10:17 AM
Last activity: May 6, 2020, 03:04 PM