This was to fix an issue I had with mrtg (using rrd files), that occured somehow when I went to reboot the vm that mrtg was using. When the vm came back up I got the error :

 ERROR: Cannot update /var/www/mrtg/xxx/10.x.x.5_xx.rrd with '1359389221:4100149299:563322753' /var/www/mrtg/xxx/10.x.x.5_xx.rrd: illegal attempt to update using time 1359389221 when last update time is 1359402962 (minimum one second step)

apparently the Round robin database (rrd) has a "last update" field that had a bad time way in the future, and that needed to be fixed.

I came across a tool at http://pierre.palatin.fr/old/rrd-repair but it is in python and requires the ElementTree module which is not readily available in fedora, and I didn't feel like compiling a library just to fix a date stamp. So that's how I came up with using sed instead, but my inspiration came from the site with the python script.

my script that doesn't require python (or the element tree library), is here

if you have a directory full of rrd files (like I do with mrtg), you will probably want to use xargs: ls -1 *.rrd |xargs rrd-fixer.sh or you can use what I did:
find . -name "*.rrd" -print0 |xargs -0 -I {} rrd-fixer.sh {}