ports/sysutils/backuppc-devel/files/patch-bin-BackupPC_rrdUpdate
Kurt Jaeger 8c87610bf5 New port: sysutils/backuppc-devel
BackupPC is a high-performance, enterprise-grade system for backing up
Linux, WinXX and MacOSX PCs and laptops to a server's disk.
BackupPC is highly configurable and easy to install and maintain.

WWW: http://backuppc.sourceforge.net

This is Version 4.0.0alpha3, please use with caution. On the other
hand, it is 10 month old, and the submitter is also the maintainer of
sysutils/backuppc.

PR:		183241
Submitted by:	Alexander Moisseev <moiseev@mezonplus.ru>
2014-10-23 17:48:35 +00:00

57 lines
1.7 KiB
Text

--- ./bin/BackupPC_rrdUpdate.orig 2013-12-09 17:06:45.000000000 +0400
+++ ./bin/BackupPC_rrdUpdate 2013-12-10 12:24:41.000000000 +0400
@@ -109,7 +109,7 @@
}
$sizeTot = $sizeTot / 1024;
- print $bpc->cmdSystemOrEval(
+ if ( $err = $bpc->cmdSystemOrEval(
[
$Conf{RrdToolPath},
"update", $RRDFile,
@@ -119,13 +119,17 @@
. $Info{"poolKb"} . ":"
. $Info{"pool4Kb"} . ":"
. $Info{"cpool4Kb"}
- ]);
- printf("%sRRD updated:"
+ ]) ) {
+ print "$err";
+ }
+ else {
+ printf("%sRRD updated:"
. " date %s; cpoolKb %f; total %f;"
. " poolKb %f; pool4Kb %f; cpool4Kb %f\n",
$bpc->timeStamp,
$NowRnd1, $Info{"cpoolKb"}, $sizeTot,
$Info{"poolKb"}, $Info{"pool4Kb"}, $Info{"cpool4Kb"});
+ }
}
#
@@ -140,7 +144,7 @@
#
# Get each pool max value from RRD
#
- $bpc->cmdSystemOrEval(
+ $bpc->cmdSystemOrEvalLong(
[
$Conf{RrdToolPath},
"graphv", "-",
@@ -158,7 +162,7 @@
if ( $_[0] =~ /^print\[([0-3])\] = "([.0-9]+)"$/ ) {
$poolMax[$1] = $2 unless ( $2 == 0 );
}
- });
+ }, 1, undef);
my $poolSizeGraph = [
"$Conf{RrdToolPath}",
@@ -228,6 +232,6 @@
print("Can't open/create $LogDir/poolUsage$weeks.png\n");
return;
}
- $bpc->cmdSystemOrEval($poolSizeGraph, sub { print $fdOut $_[0] });
+ $bpc->cmdSystemOrEvalLong($poolSizeGraph, sub { print $fdOut $_[0] }, 1, undef);
close($fdOut);
}