Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Jleagle
Posts: 9 Joined: Wed Jan 02, 2013 11:45 am
Post
by Jleagle » Wed Jan 02, 2013 10:50 pm
I have Transmission installed on a Synology NAS and I am trying to get a script to run after each download completes.
I have:
Code: Select all
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/volume1/Scripts/download_complete.sh",
in settings.json
But as far as I can tell download_complete.sh never runs. Any reasons why this might be happening?
Thanks.
JJTagy
Posts: 40 Joined: Sun Jul 29, 2012 3:15 am
Post
by JJTagy » Thu Jan 03, 2013 1:02 am
Is the .sh executable (permissions)? Have you tried running the script manually?
Jleagle
Posts: 9 Joined: Wed Jan 02, 2013 11:45 am
Post
by Jleagle » Thu Jan 03, 2013 10:15 am
The script has CHMOD 0777.
How can i run it manually, doesn't Transmission send certain parameters to the script too?
Jleagle
Posts: 9 Joined: Wed Jan 02, 2013 11:45 am
Post
by Jleagle » Thu Jan 03, 2013 10:30 pm
x190 wrote: JJTagy wrote: Is the .sh executable
chmod +x.
Also, does the script have the 'shebang' line?
I have "#!/bin/sh" as the first line..
What does "chmod +x" mean? I don't know too much command line..
killemov
Posts: 573 Joined: Sat Jul 31, 2010 5:04 pm
Post
by killemov » Fri Jan 04, 2013 12:17 am
x190 wrote: chmod +x yourscript.sh
ls -la yourscript.sh
-rwx r--r--
x is for executable.
Correct! But ...
Jleagle wrote: The script has CHMOD 0777.
How can i run it manually, doesn't Transmission send certain parameters to the script too?
Probably 777 right? So your file attributes ARE ok.
Please put a line like:
Code: Select all
echo "Script started." >> /var/lib/myscript.log
At the beginning of the script and run it manually just to test it.
Do you know HOW to run a script manually?
Jleagle
Posts: 9 Joined: Wed Jan 02, 2013 11:45 am
Post
by Jleagle » Sat Jan 05, 2013 2:11 pm
I have tried running the script like so:
Code: Select all
DiskStation> cd /volume1/Scripts
DiskStation> sh download_complete.sh
: not foundmplete.sh: line 3:
: not foundmplete.sh: line 5:
: not foundmplete.sh: line 8:
: not foundmplete.sh: line 10:
download_complete.sh: line 14: syntax error: unexpected word (expecting "do")
DiskStation>
The start of the script is this:
Code: Select all
#!/bin/sh
#Called after a download completes
echo "Script started." >> /var/lib/myscript.log
And it successfully created the file "myscript.log" with "Script started."
I deleted "myscript.log" and downloaded a torrent, the log file was never recreated.