aboutsummaryrefslogtreecommitdiff
path: root/scripts/cron.sh
diff options
context:
space:
mode:
authorChristian Segundo2023-06-10 00:11:39 +0200
committerChristian Segundo2023-06-10 00:11:39 +0200
commitbe52bd17ea01d8c302e39ba444194de282dc4728 (patch)
treeb1d69842363bce20f3b3141b529b52877dfdbbd7 /scripts/cron.sh
downloadtransmission-hacks-be52bd17ea01d8c302e39ba444194de282dc4728.tar.gz
First commit
Diffstat (limited to 'scripts/cron.sh')
-rw-r--r--scripts/cron.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/cron.sh b/scripts/cron.sh
new file mode 100644
index 0000000..3cde994
--- /dev/null
+++ b/scripts/cron.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -euo pipefail
+
+declare -A tag_age
+i=0
+while true; do
+ key="DELETE_TAG_${i}"
+ val="DELETE_AGE_${i}"
+ if [ -z "${!key:-}" ]; then
+ break
+ fi
+ tag_age["${!key}"]="${!val}"
+ i=$((i+1))
+done
+
+${PYTHON_PATH} "${SCRIPT_PREFIX}"/tag-based-on-dir.py \
+ --host "${TRANSMISSION_HOST}"
+
+${PYTHON_PATH} "${SCRIPT_PREFIX}"/ask-tracker-for-more-peers.py \
+ --host "${TRANSMISSION_HOST}"
+
+for key in "${!tag_age[@]}"
+do
+ ${PYTHON_PATH} "${SCRIPT_PREFIX}"/delete-based-on-tag.py \
+ --host "${TRANSMISSION_HOST}" \
+ --tag "${key}" \
+ --age "${tag_age[$key]}"
+done