diff options
Diffstat (limited to 'scripts/entrypoint.sh')
-rw-r--r-- | scripts/entrypoint.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index c61a0ff..93c248d 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -cat <<EOF >> /etc/cron.d/crontab +cat <<EOF >>/etc/cron.d/crontab PYTHON_PATH=/usr/local/bin/python3 SCRIPT_PREFIX=/scripts SCRIPT_TIMEOUT=${SCRIPT_TIMEOUT:-300} @@ -11,33 +11,33 @@ EOF i=0 while true; do - key="DELETE_TAG_${i}_NAME" - val="DELETE_TAG_${i}_AGE" - if [ -z "${!key:-}" ]; then - break - fi - cat <<EOF >> /etc/cron.d/crontab + key="DELETE_TAG_${i}_NAME" + val="DELETE_TAG_${i}_AGE" + if [ -z "${!key:-}" ]; then + break + fi + cat <<EOF >>/etc/cron.d/crontab DELETE_TAG_${i}=${!key} DELETE_AGE_${i}=${!val} EOF - i=$((i+1)) + i=$((i + 1)) done i=0 while true; do - key="DELETE_UNLINKED_${i}_NAME" - val="DELETE_UNLINKED_${i}_AGE" - if [ -z "${!key:-}" ]; then - break - fi - cat <<EOF >> /etc/cron.d/crontab + key="DELETE_UNLINKED_${i}_NAME" + val="DELETE_UNLINKED_${i}_AGE" + if [ -z "${!key:-}" ]; then + break + fi + cat <<EOF >>/etc/cron.d/crontab DELETE_UNLINKED_TAG_${i}=${!key} DELETE_UNLINKED_AGE_${i}=${!val} EOF - i=$((i+1)) + i=$((i + 1)) done -echo "${CRON_EXPRESSION:-* * * * *} /bin/bash /scripts/cron.sh >/proc/1/fd/1 2>/proc/1/fd/2" >> /etc/cron.d/crontab +echo "${CRON_EXPRESSION:-* * * * *} /bin/bash /scripts/cron.sh >/proc/1/fd/1 2>/proc/1/fd/2" >>/etc/cron.d/crontab cat /etc/cron.d/crontab crontab /etc/cron.d/crontab cron -f -l "${CRON_LOG_LEVEL:-0}" |