Ajust function for get total of backups (incr + full)

master
heuzef 4 years ago
parent f93c3bb658
commit 4e0b935405
  1. 8
      Check.pm

@ -36,10 +36,10 @@ sub action
# Start loop # Start loop
foreach my $host ( GetUserHosts(1) ) { foreach my $host ( GetUserHosts(1) ) {
my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor, $ifErrors, $sizeConsistency, $sizeConsistencyColor); my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor, $ifErrors, $sizeConsistency, $sizeConsistencyColor, $fullCnt, $incrCnt, $nbBackups);
my($shortErr); my($shortErr);
my @Backups = $bpc->BackupInfoRead($host); my @Backups = $bpc->BackupInfoRead($host);
my $fullCnt = $incrCnt = 0; $fullCnt = $incrCnt = $nbBackup = 0;
$bpc->ConfigRead($host); $bpc->ConfigRead($host);
%Conf = $bpc->Conf(); %Conf = $bpc->Conf();
@ -50,9 +50,9 @@ sub action
# Get number of total backups # Get number of total backups
for ( my $i = 0 ; $i < @Backups ; $i++ ) { for ( my $i = 0 ; $i < @Backups ; $i++ ) {
if ( $Backups[$i]{type} eq "full" ) { $fullCnt++; } if ( $Backups[$i]{type} eq "full" ) { $fullCnt++; }
} elsif ( $Backups[$i]{type} eq "incr" ) { $incrCnt++; } elsif ( $Backups[$i]{type} eq "incr" ) { $incrCnt++; }
} }
my $nbBackup = $fullCnt + $incrCnt; $nbBackups = $fullCnt + $incrCnt;
# Get frequency for this host # Get frequency for this host
if ( $Conf{IncrPeriod} < $Conf{FullPeriod} ) { if ( $Conf{IncrPeriod} < $Conf{FullPeriod} ) {

Loading…
Cancel
Save