Page 1 of 1

[Testing Script] Failure

Posted: 27 Nov 2019, 12:58
by sirchambo
I was testing the basic script from here: https://nzbget.net/post-processing-scripts

Code: Select all

#!/bin/sh 

#######################################
### NZBGET POST-PROCESSING SCRIPT   ###

# Print test message.
#
# This is a test script. It prints one message to log. Here in the
# long description we could write instructions for user.
#
# The long description can have multiple paragraphs when needed. Like
# this one.

### NZBGET POST-PROCESSING SCRIPT   ###
#######################################

echo "post-processing script test"
My results are odd in that the test script works, but is immediately followed by an error:
Image

Any thoughts would be appreciated.

Thanks.

Re: [Testing Script] Failure

Posted: 27 Nov 2019, 15:14
by l2g
add the following at the end and try again:

Code: Select all

exit 93

Re: [Testing Script] Failure

Posted: 28 Nov 2019, 12:14
by sirchambo
Worked! Thanks.

Is this exit call a pre-requisite for all extension scripts? If not, why was it necessary in this case?

Re: [Testing Script] Failure

Posted: 28 Nov 2019, 22:25
by l2g
NZBGet uses the exit code to determine the success of the plugin you wrote. It's a way of relaying back to the user:
  • Everything is good! I did what i was intended to do: exit 93
  • It was a failure; we just couldn't complete our task: exit 94
  • I didn't need to do anything, or I did do stuff, but it really isn't a good or bad outcome. exit 95
If you don't define an exit code, then by default zero (0) is returned (exit 0). This doesn't fit any of the expected 9X codes defined above, so NZBGet treats it as something bad happened.

It's more of just a note to keep in the back of your head when you write the scripts. Once you know this; you don't worry about it any more. You just return the code you intend on :). Good luck!

Re: [Testing Script] Failure

Posted: 29 Nov 2019, 02:00
by sirchambo
Many thanks!

Re: [Testing Script] Failure

Posted: 13 Feb 2020, 12:50
by Merlincool
I have created bash script for post processing and It transfers my files on gdrive after its completion. I am using rclone for the same.

I don't get pp successful on my log report, because I think I have done some mistake.

I know the exit code is - exit 93.

This is what I have done after my rclone commands

Code: Select all

After echo "post-processing script"

#I have copied proper values of 93,94,92 from scripts

rclone copy $FILE mygdrive:

if [ "$?" -eq "0" ]
then
        echo "exit 93";
else 
        echo "exit 94"
fi
What I am missing in this?

Re: [Testing Script] Failure

Posted: 17 Feb 2020, 15:50
by hugbug
It should be

Code: Select all

exit 93;
instead of

Code: Select all

  echo "exit 93";