X-Git-Url: http://git.rot13.org//?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_dump;fp=bin%2FBackupPC_dump;h=9dfd6c1d603bc673d6e4af07047a2fa3cab33d7d;hp=d1e8384dad1c425ebc64bda6fa4f6c1cc00ac208;hb=ca593f66fd6c35764bd8997c6338b781330f019c;hpb=3a7bc709e0ae0cbaef278a584849fcbeed202879 diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index d1e8384..9dfd6c1 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -327,6 +327,7 @@ if ( !$opts{i} && !$opts{f} && $Conf{BlackoutGoodCnt} >= 0 || !defined($p->{hourBegin}) || !defined($p->{hourEnd}) ); + my $matchWday = $wday; if ( $p->{hourBegin} > $p->{hourEnd} ) { $blackout = $p->{hourBegin} <= $currHours || $currHours <= $p->{hourEnd}; @@ -336,14 +337,14 @@ if ( !$opts{i} && !$opts{f} && $Conf{BlackoutGoodCnt} >= 0 # weekday check (eg: Monday 11pm-1am means Monday 2300 to # Tuesday 0100, not Monday 2300-2400 plus Monday 0000-0100). # - $wday--; - $wday += 7 if ( $wday < 0 ); + $matchWday--; + $matchWday += 7 if ( $matchWday < 0 ); } } else { $blackout = $p->{hourBegin} <= $currHours && $currHours <= $p->{hourEnd}; } - if ( $blackout && grep($_ == $wday, @{$p->{weekDays}}) ) { + if ( $blackout && grep($_ == $matchWday, @{$p->{weekDays}}) ) { # print(LOG $bpc->timeStamp, "skipping because of blackout" # . " (alive $StatusHost{aliveCnt} times)\n"); print(STDERR "Skipping $client because of blackout\n")