opnsense-ports/sysutils/backuppc-devel/files/patch-bin-BackupPC_rrdUpdate
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01: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);
}