Script exit codes and SAB History

Want something added? Ask for it here.
Post Reply
Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Script exit codes and SAB History

Post by Eejit »

When Sab fails to download, verify, unrar etc, it is shown nice and clear in the history with red text etc and the status for email notifications appears to be set to "False"

However, when a post-processing script exits with anything other than a "0" to show that something has probably gone wrong, SAB still displays this in the history with green text, although with with the exit code at the beginning, and the email status flag is a healthy "true"

Is it possible to alter this so SAB's history shows this as a failure in red (or orange to designate a script failure) and the email notification status set to "False", possibly by use of a special exit code such as "9999" so as not to interfere with existing
post-processing scripts?
Eejit - The name say's it all !!
Image

User avatar
shypike
Administrator
Administrator
Posts: 21043
Joined: January 18th, 2008, 12:49 pm

Re: Script exit codes and SAB History

Post by shypike »

On the todo list now.

Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Re: Script exit codes and SAB History

Post by Eejit »

Thanks very much :-)
Eejit - The name say's it all !!
Image

hugepants
Newbie
Newbie
Posts: 14
Joined: May 26th, 2013, 5:16 am

Re: Script exit codes and SAB History

Post by hugepants »

Thanks shypike, hopefully this will resolve this issue where my workaround did not work in every case.

wiggy9906
Newbie
Newbie
Posts: 17
Joined: December 9th, 2009, 2:26 pm

Re: Script exit codes and SAB History

Post by wiggy9906 »

Hi,

Is there an exit code I can use to mark the job failed, or is this something still on the todo list?

Wiggy

User avatar
shypike
Administrator
Administrator
Posts: 21043
Joined: January 18th, 2008, 12:49 pm

Re: Script exit codes and SAB History

Post by shypike »


wiggy9906
Newbie
Newbie
Posts: 17
Joined: December 9th, 2009, 2:26 pm

Re: Script exit codes and SAB History

Post by wiggy9906 »

Hi Shypike,

Thank you for the reply.

The parameters you refer to are inputs into the post processing script. I'm looking for the capability for the script to pass an exit code back to Sabnzbd that will mark the job as failed. I can't seem to do this at present. The exit code is showed in the results, if not 0, but the job status is completed, not failed.

Wiggy

User avatar
shypike
Administrator
Administrator
Posts: 21043
Joined: January 18th, 2008, 12:49 pm

Re: Script exit codes and SAB History

Post by shypike »

Ok, so you want the script to tell SABnzbd that things went wrong?
Currently SABnzbd will register the code but will not use it to "fail" the job.
This could be implemented but will require an option, to preserve compatibility with existing scripts
that aren't careful with their exit codes.
It's on the todo list now.

wiggy9906
Newbie
Newbie
Posts: 17
Joined: December 9th, 2009, 2:26 pm

Re: Script exit codes and SAB History

Post by wiggy9906 »

Thanks Shypike

User avatar
shypike
Administrator
Administrator
Posts: 21043
Joined: January 18th, 2008, 12:49 pm

Re: Script exit codes and SAB History

Post by shypike »

Implemented as "User script can flag job as failed" in Config->Switches.

Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Re: Script exit codes and SAB History

Post by Eejit »

Thanks shypike :-)
Eejit - The name say's it all !!
Image

Post Reply