From 3c0cd71bc9b7ec681a2ff373c1385cca53a9a3bf Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Fri, 6 Oct 2023 18:34:26 +0200 Subject: delete files if unlinked --- scripts/entrypoint.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts/entrypoint.sh') diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 4d89be5..e40b462 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -22,6 +22,20 @@ EOF 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 <> /etc/cron.d/crontab +DELETE_UNLINKED_TAG_${i}=${!key} +DELETE_UNLINKED_AGE_${i}=${!val} +EOF + 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 cat /etc/cron.d/crontab crontab /etc/cron.d/crontab -- cgit v1.2.3