update removal log method
This commit is contained in:
parent
c746c208ee
commit
c25a30d1a4
1 changed files with 8 additions and 5 deletions
|
@ -15,7 +15,7 @@ FILE=$1
|
|||
if [ ! -f $FILE ]
|
||||
then
|
||||
echo $(hostname) > $FILE
|
||||
echo "Create cron_lock for server"
|
||||
echo "$(date) -- START CRON_LOCK -- $(hostname)" >> $FILE.log
|
||||
|
||||
$2
|
||||
|
||||
|
@ -26,11 +26,14 @@ then
|
|||
echo "OK -- $(date) -- $(hostname)" >> $FILE.log
|
||||
fi
|
||||
|
||||
echo "Job done. Keep lock for 20 seconds"
|
||||
else
|
||||
echo "Other Server is running cron job"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sleep 10
|
||||
rm $FILE
|
||||
sleep 10.$TIME
|
||||
|
||||
if [ -f $FILE ]
|
||||
then
|
||||
echo "$(date) -- REMOVE CRON_LOCK -- $(hostname)" >> $FILE.log
|
||||
rm $FILE
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue