how to test torrent done script?
how to test torrent done script?
I'm writing a torrent done script based of the unrar and cleanup script. I want to know how to test the script? When it runs from transmission it gets a bunch of environment variables. Do I test the script by passing those as arguments? Or is there a command to tell torrent-remote to execute the script?
Re: how to test torrent done script?
see https://trac.transmissionbt.com/wiki/Ed ... Files#Misc
in settings.json:
script-torrent-done-enabled: Boolean (default = false) Run a script at torrent completion (set to true)
script-torrent-done-filename: String (default = "") Path to script (self-explanatory)
this is very simple test script to see that it works:
if all goes well, the file /tmp/test.log should be created, then you can try more useful scripts.
also make sure script has execute permissions chmod +x /path/to/your/script
in settings.json:
script-torrent-done-enabled: Boolean (default = false) Run a script at torrent completion (set to true)
script-torrent-done-filename: String (default = "") Path to script (self-explanatory)
this is very simple test script to see that it works:
Code: Select all
#!/bin/bash
echo "$TR_TORRENT_NAME is completed" >> /tmp/test.log
also make sure script has execute permissions chmod +x /path/to/your/script
Re: how to test torrent done script?
I don't think you got my OP. I need a way to test the script independently of transmission. Otherwise, I have to wait for a torrent to finish to see if the script works. That can become painful for complicated scripts.
Re: how to test torrent done script?
well you can always try manually running the script from the terminal, but the problem is if your complicated script depends on any of the transmission envirnomental variables, it won't run correctly.tetorr wrote:I don't think you got my OP. I need a way to test the script independently of transmission. Otherwise, I have to wait for a torrent to finish to see if the script works. That can become painful for complicated scripts.
why don't you find a very small torrent and use that for a test, that's what i always did.
Re: how to test torrent done script?
ok thanks. At least you confirmed that there is no easy way to do this. Was jsut hoping transmission remote could be sent a command to run the download done script on an already completed torrent.gunzip wrote:well you can always try manually running the script from the terminal, but the problem is if your complicated script depends on any of the transmission envirnomental variables, it won't run correctly.tetorr wrote:I don't think you got my OP. I need a way to test the script independently of transmission. Otherwise, I have to wait for a torrent to finish to see if the script works. That can become painful for complicated scripts.
why don't you find a very small torrent and use that for a test, that's what i always did.
Now to find a small or freeleech avi file which meets my needs...
Re: how to test torrent done script?
Cant get it to work. It is not creating a log file in /tmp. Does transmission log errors to a file somewhere?
EDIT: Found it on syslog. Set the message level to 3. IT says it calls the script. But there is no error nor confirmation message that the script worked :/
Interesting I can run my script if I type
but if I just type scriptname, without the sh, it does not run. Why is that? I did the chmod +x.
EDIT: Found it on syslog. Set the message level to 3. IT says it calls the script. But there is no error nor confirmation message that the script worked :/
Interesting I can run my script if I type
Code: Select all
sh scriptname
Re: how to test torrent done script?
you have to use a leading ./ if the script is in the current directory, such as:tetorr wrote:Interesting I can run my script if I type
Code: Select all
sh scriptname
but if I just type scriptname, without the sh, it does not run. Why is that? I did the chmod +x.
./scriptname
that's good, you got past the first hurdle, but transmission does not report whether the script was successfully run, it just lets you know it was called and attempted to run it.tetorr wrote:IT says it calls the script.
so i would say double-check your entries is settings.json , making sure there something like this
script-torrent-done-enabled: true,
script-torrent-done-filename: "/absolute/path/to/scriptname",
always use the fully-qualified path to your script or transmission won't find it.
Re: how to test torrent done script?
thanks. I found out why I couldn't run the script without sh.
The first line in the script was missing a / on the location of sh.
I've checked the location of script many times. I even moved it to another disk. I'll keep looking.
The first line in the script was missing a / on the location of sh.
I've checked the location of script many times. I even moved it to another disk. I'll keep looking.