Page 1 of 1
[LINUX] Troubles using post-processing scripts
Posted: October 28th, 2008, 12:51 pm
by doctor madness
Hi,
I configured my SABnzbd+ 0.4.4 to use a script that contains the following :
echo "dollar1 : $1
dollar2 : $2
dollar3 : $3
dollar4 : $4
dollar5 : $5
dollar6 : $6" > /tmp/toto
And other commands. The script is launched (all my commands are executed) the file /tmp/toto is created, but it contains only :
dollar1 :
dollar2 :
dollar3 :
dollar4 :
dollar5 :
dollar6 :
So, it didn't get the variables from SABnzbd+
Is there something i do wrong, or i misunderstand ?
Thanks for you support
Re: [LINUX] Troubles using post-processing scripts
Posted: October 28th, 2008, 1:24 pm
by shypike
Have you tried the sample Sample-PostProc.sh shell script in the SABnzbd distribution?
Start from that.
Re: [LINUX] Troubles using post-processing scripts
Posted: October 28th, 2008, 4:03 pm
by shypike
Have you first tried to diagnose your script from a shell script ?
What happens if you use the sample script and add your >/tmp/toto to it?
Re: [LINUX] Troubles using post-processing scripts
Posted: October 28th, 2008, 4:10 pm
by doctor madness
doctor@stan:~$ sh .sabnzbd/scripts/Sample-PostProc.sh > toto
doctor@stan:~$ cat toto
Started as .sabnzbd/scripts/Sample-PostProc.sh
The first parameter (result-dir) =
The second parameter (nzb-name) =
The third parameter (nice name) =
The fourth parameter (newzbin-id) =
The fifth parameter (category) =
The sixth parameter (group) =
When i read .sabnzbd/scripts/Sample-PostProc.sh, i can understand it will echo the previous lines + the content of different variables ($1, $2...) those variables are the args in the cmdline :
doctor@stan:~$ sh .sabnzbd/scripts/Sample-PostProc.sh test1 test2 test3 test4 test5 test6 > toto
doctor@stan:~$ cat toto
Started as .sabnzbd/scripts/Sample-PostProc.sh
The first parameter (result-dir) = test1
The second parameter (nzb-name) = test2
The third parameter (nice name) = test3
The fourth parameter (newzbin-id) = test4
The fifth parameter (category) = test5
The sixth parameter (group) = test6
So, maybe i don't understand what those post processing scripts are supposed to do. My wish is to have a post processing script changing ownership of resulting dir.
Or maybe i need to know the way SABnzb+ is launching post procs scripts
Re: [LINUX] Troubles using post-processing scripts
Posted: October 28th, 2008, 5:07 pm
by shypike
doctor madness wrote:
My wish is to have a post processing script changing ownership of resulting dir.
That should do the trick.
Re: [LINUX] Troubles using post-processing scripts
Posted: October 29th, 2008, 12:03 pm
by doctor madness
i did this in my "final" script :
#!/bin/sh
FINAL_DIR=$1
chmod 2770 $FINAL_DIR
exit 0
But i always have an error telling me :
chmod: opérande manquante après `2770' (missing operator after 2770)
Re: [LINUX] Troubles using post-processing scripts
Posted: October 29th, 2008, 1:32 pm
by shypike
There's definitely something fishy with your system or with the way you installed SABnzbd.
Have you tried alternative shells?
#!/bin/bash
#!/bin/ksh
What kind of Lnux system do you have?
Re: [LINUX] Troubles using post-processing scripts
Posted: October 29th, 2008, 4:30 pm
by doctor madness
i'm using debian etch, i tried with /bin/sh and /bin/bash
i configured for use with ksh, and i'll see what happens
about my SABnzbd installation, i just downloaded the dir from your website, then started it with my user (!=root), with this cmdline :
python /usr/local/SABnzbd/SABnzbd.py -f /home/doctor/.sabnzbd/sabnzbd.ini -s localhost:3423 -d
anything wrong with it ?
Re: [LINUX] Troubles using post-processing scripts
Posted: October 29th, 2008, 5:38 pm
by shypike
Looks all OK.
What does the logging file show (you may need to set the logging level to "debug").
Re: [LINUX] Troubles using post-processing scripts
Posted: November 3rd, 2008, 9:51 am
by doctor madness
in logs i've that line :
2008-11-03 15:40:19,765::INFO::[newsunpack] Running external script /home/doctor/.sabnzbd/scripts/postproc-defaults.sh(/home/ftp/warez/nzb/doctor/pm5.ga.s05e05.vostfr.nfo, pm5.ga.s05e05.vostfr.nfo.nzb, pm5.ga.s05e05.vostfr.nfo, , doctor, alt.binaries.gougouland)
Is it normal ? Are those values the variables sent to sabnzbd ?
EDIT : I'm idiot
I forgot to forward my variables from one script to another... i corrected it, and it's ok