From c746c208ee101c0952f1346f063618b0e6087116 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Sun, 17 Nov 2024 10:06:16 +0100 Subject: [PATCH] Update distributed_cron.sh --- distributed_cron.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/distributed_cron.sh b/distributed_cron.sh index f9dc93a..3c714c3 100644 --- a/distributed_cron.sh +++ b/distributed_cron.sh @@ -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 \ No newline at end of file