[Solved] Transmission done script not running

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
qbtklmlm
Posts: 2
Joined: Sun Jul 15, 2018 8:08 am

[Solved] Transmission done script not running

Post by qbtklmlm »

I'm trying to setup Transmission so when it finishes a torrent it calls some script, the thing is I can't figure out why it isn't working.

On my settings.json I have the following:

Code: Select all

"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/media/hdd1/finish/scripts/done.sh",
The content of done.sh is this:

Code: Select all

#!/bin/bash
name="${TR_TORRENT_NAME}"
echo "$name is done" >> /media/hdd1/finish/torrents/done
If I check the transmission log I can see this:

Code: Select all

[2018-07-15 09:31:20.165] **torrentname** Calling script "/media/hdd1/finish/scripts/done.sh" (torrent.c:2118)
The script permissions are these (I've tried changing user to debian-transmission, doesn't work either):

Code: Select all

-rwxrwxrwx 1 root root 265 jul 15 09:16 done.sh*
All folders and files related to the script (..finish/scripts/ and ..torrents/done) have the same permissions and same user/group.

It should work right? Any idea why it doesn't? If I call the script manually it echos " is done" to the file, so the script itself should work...
Anybody has had this problem before?

EDIT: I'm on Transmission 2.92 and using the daemon
Last edited by qbtklmlm on Sun Jul 15, 2018 1:34 pm, edited 1 time in total.
mike.dld
Transmission Developer
Posts: 306
Joined: Wed Dec 25, 2013 10:56 pm

Re: Transmission done script not running

Post by mike.dld »

What used are you running Transmission as? I presume (and very much hope) it's not root. If it's not root, did you try running the script as that particular user? If /media/hdd1/finish/torrents/done file already exists, what are the permissions set on it?

General advice on debugging the script itself is here: viewtopic.php?t=19088&p=76461
qbtklmlm
Posts: 2
Joined: Sun Jul 15, 2018 8:08 am

Re: Transmission done script not running

Post by qbtklmlm »

mike.dld wrote:What used are you running Transmission as? I presume (and very much hope) it's not root. If it's not root, did you try running the script as that particular user? If /media/hdd1/finish/torrents/done file already exists, what are the permissions set on it?

General advice on debugging the script itself is here: viewtopic.php?t=19088&p=76461
Thanks for pointing out that thread.
I used this on my script

Code: Select all

exec >/tmp/script.log 2>&1
set -x
and saw that it was complaining that the debian-transmission user wasn't in the sudoers file. After playing around with the permissions it ended up working.
Post Reply