Update distributed_cron.sh

This commit is contained in:
holzi1005 2024-11-17 10:06:16 +01:00
parent 15912e2aed
commit c746c208ee

View file

@ -5,7 +5,7 @@
# Usage: Use the helper script in cronjobs in hosts or containers.
# The cron_lock can be shared so the job will only be executed one.
TIME=$(shuf -i 0-800 -n1)
TIME=$(shuf -i 0-900 -n1)
sleep 0.$TIME
echo "Sleep for 0.$TIME"
@ -27,12 +27,10 @@ then
fi
echo "Job done. Keep lock for 20 seconds"
sleep 10
rm $FILE
exit 0
else
echo "Other Server is running cron job"
sleep 30
rm $FILE
exit 0
fi
sleep 10
rm $FILE