From c4ffcee3a3ebebf97810af8922bbe805410bf117 Mon Sep 17 00:00:00 2001 From: jblu Date: Mon, 19 Jun 2023 19:01:44 -0500 Subject: [PATCH] changed to supercronic --- Dockerfile | 2 +- crontab | 1 - entrypoint.sh | 9 +++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 crontab diff --git a/Dockerfile b/Dockerfile index 042d0c3..eac6b10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ from alpine:latest -RUN apk add --no-cache curl +RUN apk add --no-cache curl,supercronic COPY crontab opt COPY entrypoint.sh opt COPY phc.sh opt diff --git a/crontab b/crontab deleted file mode 100644 index e3506cb..0000000 --- a/crontab +++ /dev/null @@ -1 +0,0 @@ -*/30 * * * * . /etc/environment; sh /opt/phc.sh >> /logfile \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index ca10c91..beff1c1 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,10 @@ #!/bin/sh +CRON_CONFIG_FILE="/opt/crontab" -printenv | grep -v "no_proxy" >> /etc/environment +# CRON +get_env CRON +CRON="${CRON:-"5 * * * *"}" -crond -f \ No newline at end of file +echo "${CRON} sh /opt/phc.sh" >> "${CRON_CONFIG_FILE}" + +exec supercronic -passthrough-logs -quiet "${CRON_CONFIG_FILE}" \ No newline at end of file