[rrd-users] Help with Bash script to calc end-time in multiples of 300 ?

Rob Conway rjconway at bigpond.com
Sat Nov 18 06:41:45 MET 2006


I noted a response to a previous thread to make sure you specify end time in multiples of you step....I have just been using --end NOW and as I run this on a 266mhz processor (NSLU2) I need all the help I can get in optimisation...
I have a step time of 300 seconds and use bash shell scripting.......Can anyone assist in a code snippet to enable me to somehow round my time to the nearest 300 ?

I just use "date +%s" to get the unix time but how can I easily round this value ?


quote:  from Alex

 Set start and end times to a whole multiple of the amount of seconds
  per pixel.  Not: "end=now" (either explicitly or implicitly), but
  "end=${endtime}" where variable endtime is computed by your front end
  and is a whole multiple of 3600 (or 86400, or 300, or 604800 etc.)
  whatever your step*steps is.


thanks  rob
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list