diff options
author | Christian Segundo | 2023-10-06 18:34:26 +0200 |
---|---|---|
committer | Christian Segundo | 2023-10-06 19:34:13 +0200 |
commit | 3c0cd71bc9b7ec681a2ff373c1385cca53a9a3bf (patch) | |
tree | 7a726e978e9f8869e8bca79ebf37397a830b5e5c /scripts/entrypoint.sh | |
parent | 02b189653a1f4a3b98fc200e2280c86aa31eda5c (diff) | |
download | transmission-hacks-3c0cd71bc9b7ec681a2ff373c1385cca53a9a3bf.tar.gz |
delete files if unlinked
Diffstat (limited to 'scripts/entrypoint.sh')
-rw-r--r-- | scripts/entrypoint.sh | 14 |
1 files changed, 14 insertions, 0 deletions
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 <<EOF >> /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 |