nnCron Lite not completely running all events of a script

nnCron and nnCron LITE discussion

nnCron Lite not completely running all events of a script

Postby rleebife » Tue, 07 Aug 2007, 18:45

Hi,
I am running nnCron Lite v117.
I have a shell script called 'mycarbonreminder.sh' which runs as it should do when i run it without nnCron:

#!/bin/bash
SQL_HOST=localhost
SQL_USER=root
SQL_PASSWORD="ghana2"
SQL_DATABASE=carbon
SQL_TABLE=sms
MYSQL=/cygdrive/c/wamp/mysql/bin/mysql.exe

today=`date +%Y-%m-%d`
#Set some SQL parameters
if [ "$SQL_PASSWORD" != "" ]; then
SQL_ARGS="-p$SQL_PASSWORD";
else
SQL_ARGS="";
fi
SQL_ARGS="-h $SQL_HOST -u $SQL_USER $SQL_ARGS -D $SQL_DATABASE -s -e"
#QUERY THE DATABASE FOR entries with today's date and put those entries into the file named "remindlist"
$MYSQL $SQL_ARGS "select usrMob from $SQL_TABLE where date=\"$today\";" >> /tmp/remindlist
while read line; do
number=`echo $line | cut -f1 -d' '`
sendsms $number "Please send your vehicle mileage by replying to this message with your current value! You will then be sent your CO2 credit."
done < /tmp/remindlist



However, when i get nncron Lite to run the script it manages to create the file "/tmp/remindlist" but doesn't output any data from the database query!?
My cron.tab looks like this:

#Start the cronjob at 16.30 every evening
30 16 * * * c:\cygwin\bin\bash -c "/usr/local/bin/mycarbonreminder.sh"


I have tried many variations and tried different scripts but the data is never outputted to the "/tmp/somefile" file.
As i said, the script works fine when it isn't controlled by nnCRon Lite and all works as it should.
Thanks
rleebife
 
Posts: 1
Joined: Tue, 07 Aug 2007, 18:39

Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest

cron