From: Michael Gernoth 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 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 "
\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 "
"; @@ -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 "
"; @@ -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 "
";