Post Processing Help

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
suspiciousduck
Newbie
Newbie
Posts: 5
Joined: May 18th, 2018, 7:41 pm

Post Processing Help

Post 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 ?
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Post Processing Help

Post by sander »

My guess: your /bin/sh does not know "-xu".

So remove "-xu" from the script and try again.
suspiciousduck
Newbie
Newbie
Posts: 5
Joined: May 18th, 2018, 7:41 pm

Re: Post Processing Help

Post 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
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Post Processing Help

Post 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.
suspiciousduck
Newbie
Newbie
Posts: 5
Joined: May 18th, 2018, 7:41 pm

Re: Post Processing Help

Post 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...
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Post Processing Help

Post by sander »

No such file or directory ... seems clear to me
suspiciousduck
Newbie
Newbie
Posts: 5
Joined: May 18th, 2018, 7:41 pm

Re: Post Processing Help

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Post Processing Help

Post 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
suspiciousduck
Newbie
Newbie
Posts: 5
Joined: May 18th, 2018, 7:41 pm

Re: Post Processing Help

Post 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!
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Post Processing Help

Post by sander »

I'll reach out to the server provider
Which server provider? And what kind of server?
Post Reply