Exclude only hosts when BackupsDisable == 2

BackupsDisable equal to 1 mean backup could always be done manually.
This commit is contained in:
Benjamin Renard 2021-12-17 10:36:18 +01:00
parent b2446abfd0
commit 1e30357cc3
2 changed files with 2 additions and 2 deletions

View file

@ -151,7 +151,7 @@ foreach my $host (sort(keys(%Status)))
next if (@ownerOnly and not grep {/$owner/} @ownerOnly);
my %host_conf = %{$server->ConfigDataRead($host)};
$Status{$host}{BackupsDisable} = $host_conf{BackupsDisable};
next if ( $Status{$host}{BackupsDisable} and not $forceCheckOnDisabledHosts);
next if ( $Status{$host}{BackupsDisable} eq 2 and not $forceCheckOnDisabledHosts);
next if (@hostsDesired and not grep {/^$host$/} @hostsDesired);
next if (@hostsExcluded and grep {/^$host$/} @hostsExcluded);
next if ($Status{$host}{'type'} eq 'archive');

View file

@ -122,7 +122,7 @@ foreach my $hostname ( sort(keys %Status) ) {
my %HostStatus = %{$Status{$hostname}};
my %host_conf = %{$server->ConfigDataRead($hostname)};
$HostStatus{BackupsDisable} = $host_conf{BackupsDisable};
next if ( $HostStatus{BackupsDisable} );
next if ( $HostStatus{BackupsDisable} eq 2);
next if ($HostStatus{'type'} eq 'archive');
$host_count++;