[rrd-users] update using crontab

zura baizura zrbaizura at yahoo.com
Fri Mar 16 10:08:40 CET 2007


hello.......


hi im again .
i have correct my script and i try it to crontab.

correct, the error isn't there anymore.Thanks so much.
           ---------my correction script---------
#!/bin/sh
rrdtool create sss.rrd --step 300 \
DS:voltan:GAUGE:600:0:U   \
RRA:LAST:0.5:1:200
MyHome="/home/baizura/"
DATA=`tail -1 "${MyHome}percubaan/reading" | gawk
'{print $1}'`
/bin/echo $DATA
TIMESTAMP=`/bin/date +%s`
/bin/echo $TIMESTAMP
/bin/rrdtool update sss.rrd  $TIMESTAMP:$DATA
/bin/rrdtool fetch sss.rrd LAST --start 1174031149
/bin/rrdtool graph voltan.png -s 1174031149 -h 400 \
         DEF:voltage=sss.rrd:voltan:LAST
-----------------------------------------------------
I PUT  VALUE OF VOLTAGE IN FILE
/HOME/BAIZURA/PERCUBAAN/READING , so in the file
/home/baizura/percubaan/reading the last data will be
update to script as above. Here the last data is
=2.0(i try 2.0 to test my crontab and my script to see
it does work or not).
my question is: i want to know is the result if using
crontab is like this:-

Date: Fri, 16 Mar 2007 16:20:01 +0800
Message-Id:
<200703160820.l2G8K1KV003556 at localhost.localdomain>
From: root at localhost.localdomain (Cron Daemon)
To: root at localhost.localdomain
Subject: Cron <root at localhost>
/home/baizura/percubaan/lost.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

2.0
1174033201
                         voltan

1174031400: nan
1174031700: nan
1174032000: nan
1174032300: nan
1174032600: nan
1174032900: nan
1174033200: 2.0000000000e+00
1174033500: nan
0x0

>From root at localhost.localdomain  Fri Mar 16 16:25:01
2007
Return-Path: <root at localhost.localdomain>
Received: from localhost.localdomain
(localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.5/8.12.5) with ESMTP
id l2G8P1E3003647
	for <root at localhost.localdomain>; Fri, 16 Mar 2007
16:25:01 +0800
Received: (from root at localhost)
	by localhost.localdomain (8.12.5/8.12.5/Submit) id
l2G8P1ov003640
	for root; Fri, 16 Mar 2007 16:25:01 +0800
Date: Fri, 16 Mar 2007 16:25:01 +0800
Message-Id:
<200703160825.l2G8P1ov003640 at localhost.localdomain>
From: root at localhost.localdomain (Cron Daemon)
To: root at localhost.localdomain
Subject: Cron <root at localhost>
/home/baizura/percubaan/lost.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

2.0
1174033501
                         voltan

1174031400: nan
1174031700: nan
1174032000: nan
1174032300: nan
1174032600: nan
1174032900: nan
1174033200: nan
1174033500: 2.0000000000e+00
1174033800: nan
0x0

>From root at localhost.localdomain  Fri Mar 16 16:30:01
2007
Return-Path: <root at localhost.localdomain>
Received: from localhost.localdomain
(localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.5/8.12.5) with ESMTP
id l2G8U1E3003729
	for <root at localhost.localdomain>; Fri, 16 Mar 2007
16:30:01 +0800
Received: (from root at localhost)
	by localhost.localdomain (8.12.5/8.12.5/Submit) id
l2G8U0te003721
	for root; Fri, 16 Mar 2007 16:30:00 +0800
Date: Fri, 16 Mar 2007 16:30:00 +0800
Message-Id:
<200703160830.l2G8U0te003721 at localhost.localdomain>
From: root at localhost.localdomain (Cron Daemon)
To: root at localhost.localdomain
Subject: Cron <root at localhost>
/home/baizura/percubaan/lost.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

2.0
1174033800
                         voltan

1174031400: nan
1174031700: nan
1174032000: nan
1174032300: nan
1174032600: nan
1174032900: nan
1174033200: nan
1174033500: nan
1174033800: 2.0000000000e+00
1174034100: nan
0x0

>From root at localhost.localdomain  Fri Mar 16 16:35:01
2007
Return-Path: <root at localhost.localdomain>
Received: from localhost.localdomain
(localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.5/8.12.5) with ESMTP
id l2G8Z1E3003814
	for <root at localhost.localdomain>; Fri, 16 Mar 2007
16:35:01 +0800
Received: (from root at localhost)
	by localhost.localdomain (8.12.5/8.12.5/Submit) id
l2G8Z1lD003807
	for root; Fri, 16 Mar 2007 16:35:01 +0800
Date: Fri, 16 Mar 2007 16:35:01 +0800
Message-Id:
<200703160835.l2G8Z1lD003807 at localhost.localdomain>
From: root at localhost.localdomain (Cron Daemon)
To: root at localhost.localdomain
Subject: Cron <root at localhost>
/home/baizura/percubaan/lost.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

2.0
1174034101
                         voltan

1174031400: nan
1174031700: nan
1174032000: nan
1174032300: nan
1174032600: nan
1174032900: nan
1174033200: nan
1174033500: nan
1174033800: nan
1174034100: 2.0000000000e+00
1174034400: nan
0x0
------------------------------------------------------


 


 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367



More information about the rrd-users mailing list