[rrd-users] a few question to ask

Fabien Wernli wernli at in2p3.fr
Thu Mar 22 07:57:43 CET 2007


On Wed, Mar 21, 2007 at 08:17:52PM -0700, zura baizura wrote:
> how to change my script. Before this the script is
> using TIMESTAMP=`date +%s`.

use TIMESTAMP=`date +%s -d now-5min`

> and bytheway the time of data is not at every 5
> minutes or else because he wants the time is random. i
> know that i can update the data manually like in
> tutorial but i want the script run it.

add a random sleep, something like:
sleep $(($RANDOM%60))

> 11.50     2.2
> and so on-----------------
> 
> 
> how can i change the time into seconds so i can use
> the date in script.

time="11.50"
time=`echo today $time | sed 's/\./:/'`
#hh=$(echo $time | cut -d. -f1)
#mm=$(echo $time | cut -d. -f2)

rtime=`date +%s -d "$time"`



More information about the rrd-users mailing list