[rrd-users] problem update with crontab

Simon Hobson linux at thehobsons.co.uk
Wed Mar 14 08:58:59 CET 2007


zura baizura wrote:

>gawk: cmd. line:2: (END OF FILE)
>gawk: cmd. line:2: parse error
>ERROR: opening 'sss.rrd': No such file or directory
>ERROR: opening 'sss.rrd': No such file or directory
>-----------------------------------------------------
>please... help me to fix the crontab error...


It's a common problem, your script works fine when run manually but 
fails when run by crontab. Usually it's a difference in environment - 
either environment settings or path.

I normally use full paths for everything when writing scripts for cron, eg :

#!/bin/sh
MyHome="/home/baizura/"
          DATA=`tail -1 "${MyHome}percubaan/reading" | gawk {print $1} -`
         /bin/echo $DATA
         TIMESTAMP=`/bin/date +%s`
         /bin/echo $TIMESTAMP
         /usr/local/bin/rrdtool update "${MyHome}sss.rrd" $TIMESTAMP:$DATA
/usr/local/bin/rrdtool fetch sss.rrd LAST --start 1173839600


BTW - I think you may also have had an error in the DATA= line, but 
I'm not sure (haen't really got going yet today !).



More information about the rrd-users mailing list