What is the different between cron executing and shell execution?
Hello,
I have a bash script which runs perfectly in the shell. But when cron
executes the same script it causes errors.
if ( ! $SAV_INSTALL_PRG $SAV_INSTALL_OPTIONS 1>/dev/null )
then
echo "Unable to install the new engine"
echo "Command: \"$SAV_INSTALL_PRG $SAV_INSTALL_OPTIONS\""
LOG2SYSLOG "ERROR: Unable to install the new engine."
else
cd $TMP
/bin/rm -rf $TMP/$TMP_SAV_INSTALL
/bin/rm -f $IDE_DIR/*.ide
LOG2SYSLOG "Successfully installed new sophos antivirus engine"
fi
All variables are defined in the header of this script.
and LOG2SYSLOG looks like this:
LOG2SYSLOG()
{
MY_NAME=`basename $0`
MY_PID=`pidof -x $MY_NAME`
logger -t "$MY_NAME[$MY_PID]" $1
}
The error message is this:
Unable to install the new engine
Command: "/tmp/sav-install/install.sh -ni"
logger: invalid option -- n
usage: logger [-is] [-f file] [-p pri] [-t tag] [-u socket] [ message
... ]
I never call logger with a "n" option rather I call $SAV_INSTALL_PRG
with an "n" option.
I dont see why logger get the "n" option...
Does anyone see the error?
Thank you for your efforts.
--
h.wulff
[dont send me an email]
Reply to: