diff --git a/README.md b/README.md index 183ea8f..0b91ed4 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,8 @@ Usage: * Adjust other parameters if needed (see comments) * Make the script run by cron e.g. every minute * You're done + +Cron Setup: +* Open Crontab using crontab -e +* For Updating Trackers to Every New Torrent Every 15 Minutes Add: */15 * * * * /usr/bin/sh [path]]/transmission-trackers-auto-cron.sh +* Modify the transmission-trackers-auto.sh file as per your needs. We have provided two options, transmission-daemon & docker \ No newline at end of file diff --git a/transmission-trackers-auto-cron.sh b/transmission-trackers-auto-cron.sh new file mode 100644 index 0000000..7aca918 --- /dev/null +++ b/transmission-trackers-auto-cron.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# If you are using transmission-daemon directly on system the below code will ensure that trackers script run only when it is running +if [ "$(systemctl is-active transmission-daemon)" = "active" ] +then +/usr/bin/python3 [path]]/transmission-trackers.py +fi + +# If you are using docker for transmission use the following. Replace 'docker-container-name' with the appropriate name +if [ "$( docker container inspect -f '{{.State.Running}}' 'docker-container-name' )" = "true" ] +then +/usr/bin/python3 [path]]/transmission-trackers.py +fi \ No newline at end of file diff --git a/transmission-trackers.py b/transmission-trackers.py index 6c569b4..01a9d30 100755 --- a/transmission-trackers.py +++ b/transmission-trackers.py @@ -253,5 +253,7 @@ def readLocalLists(): if diff: lg('{}: Adding {} trackers (before: {})'.format(t.name, len(diff), len(ttrk))) tc.change_torrent(t.id, trackerAdd=list(diff)) + time.sleep(1) + tc.reannounce_torrent(t.id) else: dbg('{}: update not needed'.format(t.name))