aboutsummaryrefslogtreecommitdiff
path: root/files/rtcron.sh
diff options
context:
space:
mode:
Diffstat (limited to 'files/rtcron.sh')
-rw-r--r--files/rtcron.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/files/rtcron.sh b/files/rtcron.sh
new file mode 100644
index 0000000..7427b9f
--- /dev/null
+++ b/files/rtcron.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# https://code.google.com/p/pyroscope/wiki/RtControlExamples
+#
+
+# Socket
+RT_SOCKET=/var/cache/torrent/rtorrent/.scgi_local
+
+# Control app
+rtcontrol=/var/cache/torrent/bin/rtcontrol
+
+# Ratio Management
+$rtcontrol is_complete=yes is_open=yes [ ratio=+1.1 OR seedtime=+1w ] --stop
+
+# Move on Completion
+#$rtcontrol --from-view complete 'realpath=*/work/*' -qo '~/bin/rtmv "$(path)s" /var/cache/media/seeding --cron' | bash
+
+# Move on Done
+$rtcontrol --from-view complete [ 'realpath=*/work/*' OR 'realpath=*/seeding/*' ] is_open=n -qo '~/bin/rtmv "$(path)s" /var/cache/media/incoming --cron' | bash
+
+# Automatic stop of torrents having problems
+# Stops any torrent that isn't known by the tracker anymore,
+# or has other authorization problems, or lost its data
+test -S $RT_SOCKET && $rtcontrol --from-view started 'message=*not?registered*,*unregistered*,*not?authorized*' OR is_complete=yes is_ghost=yes --stop --cron