From: Michael Gernoth <michael@gernoth.net> Date: Wed, 10 Feb 2010 21:54:26 +0000 (+0100) Subject: make lazy really work... X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/upsgraph/commitdiff_plain/e26b065f3d496edd6845b58c5a3598793315876f?ds=sidebyside;hp=0d418146ac71e4ec7975b8e948765ce3add600be make lazy really work... --- diff --git a/upsgraph.pl b/upsgraph.pl index cc98e64..04a4f8c 100755 --- a/upsgraph.pl +++ b/upsgraph.pl @@ -8,6 +8,7 @@ if ((@ARGV != 1) && (@ARGV != 2)) { use Net::SNMP; use IO::Socket::INET; use RRDs; +use File::Copy; use Data::Dumper; $UPSGRAPH::outdir = ""; @@ -331,7 +332,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.png.new", "${outdir}/${hostname}.${var}.png"); + copy("${outdir}/${hostname}.${var}.png.new", "${outdir}/${hostname}.${var}.png"); } print HTML "<a href=\"${hostname}.${var}.html\"><img src=\"${hostname}.${var}.png\" width=\"${width}\" height=\"${height}\" border=\"0\"></a><br>\n"; @@ -360,7 +361,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.long.png.new", "${outdir}/${hostname}.${var}.long.png"); + copy("${outdir}/${hostname}.${var}.long.png.new", "${outdir}/${hostname}.${var}.long.png"); } print HTML2 "<img src=\"${hostname}.${var}.long.png\" width=\"${width}\" height=\"${height}\"><br>"; @@ -372,7 +373,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.week.png.new", "${outdir}/${hostname}.${var}.week.png"); + copy("${outdir}/${hostname}.${var}.week.png.new", "${outdir}/${hostname}.${var}.week.png"); } print HTML2 "<img src=\"${hostname}.${var}.week.png\" width=\"${width}\" height=\"${height}\"><br>"; @@ -384,7 +385,7 @@ while(1) { if (RRDs::error) { print "Error while graphing: " . RRDs::error . "\n"; } else { - rename("${outdir}/${hostname}.${var}.year.png.new", "${outdir}/${hostname}.${var}.year.png"); + copy("${outdir}/${hostname}.${var}.year.png.new", "${outdir}/${hostname}.${var}.year.png"); } print HTML2 "<img src=\"${hostname}.${var}.year.png\" width=\"${width}\" height=\"${height}\"><br>";