Page 1 of 1

Post Processing Help

Posted: May 18th, 2018, 8:27 pm
by suspiciousduck
Hi Everyone!

I've got SAB up and running and was hoping to get some help with a post-processing script. Here is the script I want to run. (the filebot commands all work, I've tested them manually).

Code: Select all

#!/bin/sh -xu

 
FILE_PATH="$1"
FILE_NAME="$3"
FILE_CATEGORY="$5"

filebot -script /scripts-master/amc --output "/Media" --action move -non-strict --log-file amc.log --def excludeList=amc.txt --def movieFormat="/Media/Movies/{n} ({y})/{n} [{y}.{vf}]" ut_dir="$FILE_PATH" ut_kind="multi" ut_title="$FILE_NAME" ut_label="$FILE_CATEGORY"
But once something finishes in SAB, and the script attempts to run, this is the error I get: Exit(2) -abefhkmnptuvxBCHP or -o option. When I click on "More" this is what it gives me.

Code: Select all

/bin/sh: -
: invalid option
Usage:	/bin/sh [GNU long option] [option] ...
/bin/sh [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--rcfile
--restricted
--verbose
--version
Shell options:
-ilrsD or -c command or -O shopt_option		(invocation only)
-abefhkmnptuvxBCHP or -o option
Any idea what's going on ?

Re: Post Processing Help

Posted: May 19th, 2018, 12:45 am
by sander
My guess: your /bin/sh does not know "-xu".

So remove "-xu" from the script and try again.

Re: Post Processing Help

Posted: May 19th, 2018, 6:53 am
by suspiciousduck
So, after removing -xu, SAB can’t run the script at all. Just says “Exit(-1) Cannot run script“

Also, I have this script, with -xu in the first line, running and working just fine with rtorrent post-processing. Which makes all of this even more confusing

Re: Post Processing Help

Posted: May 19th, 2018, 7:07 am
by sander
That is SABnzb saying it cannot run the script.

Set SAB's logging to +Debug, re-run, and check sabnzbd.log

You will see a line "Failed script %s, Traceback: ", which will explain more.

Re: Post Processing Help

Posted: May 19th, 2018, 7:17 am
by suspiciousduck
Here's what I get from the log...

2018-05-19 03:58:03,514::DEBUG::[newsunpack:189] Failed script /home/billybob/postprocess[dot]sh, Traceback:
Traceback (most recent call last):
File /usr/share/sabnzbdplus/sabnzbd/newsunpack[dot]py, line 166, in external_processing
startupinfo=stup, env=env, creationflags=creationflags)
File /usr/lib/python2.7/subprocess[dot]py, line 711, in __init__
errread, errwrite)
File /usr/lib/python2.7/subprocess[dot]py, line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory


Sorry, had to put [dot] in there cause the editor kept saying it wouldn't let me post links...

Re: Post Processing Help

Posted: May 19th, 2018, 7:58 am
by sander
No such file or directory ... seems clear to me

Re: Post Processing Help

Posted: May 19th, 2018, 8:28 am
by suspiciousduck
Sorry for my noobishness..what file/directory can’t it find?

The reason I’m confused is because this script runs in rtorrent for postprocessing. So rtorrent can run it fine, but SAB can’t.

Thanks for all the help on this btw.

Re: Post Processing Help

Posted: May 19th, 2018, 12:40 pm
by sander
With this script

Code: Select all

#!/bin/wrong-shebang
echo "hello"
SABnzbd says

Code: Select all

2018-05-19 17:49:24,804::INFO::[newsunpack:172] Running external script /home/<USERNAME>/sabnzbd/post-processing-scripts/wrong-shebang.sh(/media/<USERNAME>/BDEDrive/Downloads/complete/reftestnzb 333MB e7ddd3dc019d, reftestnzb 333MB e7ddd3dc019d.nzb, reftestnzb 333MB e7ddd3dc019d, , *, alt.binaries.test, 0, )
2018-05-19 17:49:24,849::DEBUG::[newsunpack:201] Failed script /home/<USERNAME>/sabnzbd/post-processing-scripts/wrong-shebang.sh, Traceback: 
Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/sabnzbd/newsunpack.py", line 175, in external_processing
    startupinfo=stup, env=env, creationflags=creationflags)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
so ... re-check your script. Check the she-bang again. Post the script here, if you want

Re: Post Processing Help

Posted: May 19th, 2018, 2:23 pm
by suspiciousduck
Gotcha. Alright well I'm lost. I guess I'll reach out to the server provider. I'm running this on a server, and I can't figure out what the correct #! should be on my own.

Thanks for the help though!

Re: Post Processing Help

Posted: May 20th, 2018, 3:14 am
by sander
I'll reach out to the server provider
Which server provider? And what kind of server?