Page 1 of 1

"On Finish" not running script

Posted: April 21st, 2010, 2:22 pm
by agentgreen
Hello,

If this has been answered before, please point me in the right direction.

I'm attempting to run a script on queue finish, and it doesn't seem to want to do it. I know the "On Finish" thing works, because when I set it to Shutdown SABnzbd, it worked fine.

The script I'm trying to run is this:

updatelibrary.bat:

echo %date% %time% >> c:\test.txt
C:\python26\python.exe "C:\Program Files\SABnzbd\Post-Processing\RescanXBMC.py"


RescanXBMC.py:

import urllib

urllib.urlopen("http://xbmc:xbmc@127.0.0.1/xbmcCmds/xbm ... o)").close()

Before anyone asks, I have verified these scripts do what they are supposed to do when ran manually (double click them or from cmd.exe).

In SAB, I choose "On Finish" and select the updatelibrary.bat file. I then download something and watch XBMC to see if it updates and I don't see anything.

Am I missing something here? Are only certain types of files allowed for this "On Finish" option?

Any help would be appreciated.

Thanks!

Re: "On Finish" not running script

Posted: April 21st, 2010, 2:30 pm
by shypike
Does the script run at all (is the c:\test.txt file updated)?
Do you get errors?
Anything visible in the log file?

Re: "On Finish" not running script

Posted: April 21st, 2010, 2:33 pm
by agentgreen
No, the date isn't even put in the test.txt file. This is what is confusing me.

Here are the logs:

2010-04-21 15:27:33,780::INFO::[postproc:568] Queue has finished, launching: (updatelibrary.bat)
2010-04-21 15:27:33,780::INFO::[__init__:592] Spawning external command C:\Program Files\SABnzbd\Post-Processing\updatelibrary.bat

Re: "On Finish" not running script

Posted: April 21st, 2010, 2:57 pm
by agentgreen
As a note, post-processing scripts run just fine. I also tried setting SAB to run as Administrator. Running Windows 7 also.

Re: "On Finish" not running script

Posted: April 21st, 2010, 3:24 pm
by agentgreen
Finally, when I set the script as a post-processing script, it worked just fine.

Re: "On Finish" not running script

Posted: April 21st, 2010, 5:15 pm
by shypike
I think you have hit a bug.
The script runs alright, but only once.
The second time you have end-of-queue, the script is not run.
Only when you unset it and set it again.
Makes sense to some extent, because most other options terminate the program.
But it isn't right for batchfiles (or sleep/hibernate).

Re: "On Finish" not running script

Posted: April 21st, 2010, 6:37 pm
by agentgreen
Glad to see I'm not crazy :P

I will just set up my script as a post-processor.

Thanks!