Forum
Remove finished torrent script (transmission) - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: Remove finished torrent script (transmission) (/thread-2781.html)



Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015 12:47 AM

Fellow Xbianians,

I'm searching for a script that removes finished torrents from transmission. I came across some but they are for different devices.

I was wondering if anyone got this to work on the xbian setup. I'm a bit o a linux & scripting noob just started digging in last week. it might be that "transmission-remote" doesn't get found in this? but what do i know...[/term]

I know your gonna say "just use rtorrent!" but i installed koper89's package and is doesn't communicate with SR or CP. I tried changing the socket stuff to ports, per directions in the thread, but this didn't help rutorrent just couldn't find rtorrent anymore.

If anyone has any directions on either one, it would be much apreciated.

Cheers,
Ragman


RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015 02:05 AM

So i've been searching around and tinkered a bit.
this is what i came up with:

Code:
#!/bin/bash
PORT="Your_Port"
USER="Your_Login"
PASS="Your_Password"

transmission-remote $PORT --auth $USER:$PASS  --torrent $TR_TORRENT_ID --remove

I read somewhere that the script that runs on_Done get fed the torrent var's. so $TR_TORRENT_ID should get the ID from the torrent that triggered the script.


RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015 03:22 AM

Been trying this out but no sigar...

Is there anyway to check if the script is even ran? checked for a log fil but there doesn't seem to be one

k made some changes to get a log going to see if the scrip starts.

Code:
#!/bin/bash

echo Testing Download finished Deleting $TR_TORRENT_NAME >> /home/xbian/NewTorrents.log
transmission-remote 9091 --auth xbian:raspberry  --torrent $TR_TORRENT_ID --remove

if i run the script in terminal it adds a line to the log file. but nothing comes up when a torrent finishes.

I checked the settings... its set to true and the path is /home/xbian/t-clean.sh


RE: Remove finished torrent script (transmission) - Ragman - 25th Feb, 2015 04:38 AM

Ha! i got it figured.

*I've stopped the transmission service in putty through the xbian GUI.

* Next i've made this script and put it into /home/xbian/t-clean.sh

Code:
#!/bin/bash
PORT="Your_Port"
USER="Your_Login"
PASS="Your_Password"

transmission-remote $PORT --auth $USER:$PASS  --torrent $TR_TORRENT_ID --remove
done

* next i've edit the /etc/transmission/settings.json

Code:
"script-torrent-done-enabled": true,
    "script-torrent-done-filename": "/home/xbian/t-clean.sh",

* Start Transmission again in the Xbian GUI

now it seems to works like a charm.
The longer script in my first post also works. Seems like i just needed to stop transmission before editing the files.

Cheers, thnx for the forum space to set up my trail of thoughed. ;P