No arguments to script on queue finishing

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
doncroco
Newbie
Newbie
Posts: 2
Joined: August 14th, 2010, 5:09 am

No arguments to script on queue finishing

Post by doncroco »

Hello,

I am trying to set up a script on finishing queue, but I have a problem with the arguments. It seems that no arguments are passed to the script. Here is the script :

Code: Select all

#!/bin/sh

echo
echo "Started as $0" > /tmp/notify_rabbit.txt
echo "Number of arguments : $#" >> /tmp/notify_rabbit.txt
echo "All arguments : $* " >> /tmp/notify_rabbit.txt
echo "And this arguments : $@ " >> /tmp/notify_rabbit.txt
echo "The first parameter (result-dir)  =" "$1" >> /tmp/notify_rabbit.txt
echo "The second parameter (nzb-name)   =" "$2" >> /tmp/notify_rabbit.txt
echo "The third parameter (nice name)   =" "$3" >> /tmp/notify_rabbit.txt
echo "The fourth parameter (newzbin-id) =" "$4" >> /tmp/notify_rabbit.txt
echo "The fifth parameter (category)    =" "$5" >> /tmp/notify_rabbit.txt
echo "The sixth parameter (group)       =" "$6" >> /tmp/notify_rabbit.txt
echo "The seventh parameter (status)    =" "$7" >> /tmp/notify_rabbit.txt
echo "Env : " >> /tmp/notify_rabbit.txt
env  >> /tmp/notify_rabbit.txt
Here is the result :

Code: Select all

Number of arguments : 0
All arguments :  
And this arguments :  
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)       = 
The seventh parameter (status)    = 
Env : 
SUDO_GID=1000
MAIL=/var/mail/don
HOME=/home/don
DPKG_MAINTSCRIPT_ARCH=all
SUDO_UID=1000
LOGNAME=root
DPKG_RUNNING_VERSION=1.15.5.6ubuntu2
TERM=xterm-color
USERNAME=root
PATH=/sbin:/usr/sbin:/bin:/usr/bin
LANG=fr_FR
DPKG_MAINTSCRIPT_PACKAGE=sabnzbdplus
SUDO_COMMAND=/usr/bin/aptitude safe-upgrade
SHELL=/bin/bash
SUDO_USER=don
DPKG_NO_TSTP=yes
PWD=/usr/bin
I am running sabnzbd version 0.5.3, from ubuntu 10.04 packages.

Any advice ?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: No arguments to script on queue finishing

Post by shypike »

Hard to tell.
What happens if you run the supplied sample script Sample-PostProc.sh ?
(It's in SABnzbd program folder).
doncroco
Newbie
Newbie
Posts: 2
Joined: August 14th, 2010, 5:09 am

Re: No arguments to script on queue finishing

Post by doncroco »

In fact, it's nearly the sample script. So the result is the same.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: No arguments to script on queue finishing

Post by shypike »

I just tested on Ubuntu 10.4, with the "official" package for SABnzbd-0.5.0.
It works fine with Sample-PostProc.sh
0.5.3 from sources, works too.
Can you check in the log file what is passed to the script (you may need to set log level to "debug") ?
Search for "Running external script".
The line should show the full script path and a comma-separated list of parameters.
Post Reply