update removal log method

This commit is contained in:
holzi1005 2024-11-17 10:25:06 +01:00
parent c746c208ee
commit c25a30d1a4

View file

@ -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