[rrd-users] RE : Re: problem update with crontab

Guennoc Bernard bernardguennoc at yahoo.fr
Thu Mar 15 19:26:31 CET 2007


just a guess but the instruction:
  gawk {print $1} ..
  should be changed to:
  gawk '{print $1}' ..

  
Simon Hobson <linux at thehobsons.co.uk> a écrit :
  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 !).

_______________________________________________
rrd-users mailing list
rrd-users at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070315/e1bf8759/attachment.htm 


More information about the rrd-users mailing list