From 008f6686ea77387abf82b05a82c3ac55dcbe7fbd Mon Sep 17 00:00:00 2001 From: Antoine LCDP Date: Tue, 18 Feb 2020 12:36:19 +0100 Subject: [PATCH] Override the full crontab every time instead of adding in (avoid multiple execution in parallel on container stop/start) --- start.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index 3ba0679..78129cb 100644 --- a/start.sh +++ b/start.sh @@ -5,8 +5,9 @@ set -e export OPTIONS=$OPTIONS if [[ "$1" == 'now' ]]; then - exec /curl.sh + exec /curl.sh else - echo "$CRON_SCHEDULE /curl.sh" >> /var/spool/cron/crontabs/root - crond -l 2 -f + echo "$CRON_SCHEDULE /curl.sh" | crontab -u root - + + crond -l 2 -f fi