* Changes in preparation for 3.2.0beta1...
[BackupPC.git] / bin / BackupPC_dump
index 243be55..9dfd6c1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/perl
+#!/usr/bin/perl
 #============================================================= -*-perl-*-
 #
 # BackupPC_dump: Dump a single client.
@@ -59,7 +59,7 @@
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
-#   Copyright (C) 2001-2007  Craig Barratt
+#   Copyright (C) 2001-2009  Craig Barratt
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -77,7 +77,7 @@
 #
 #========================================================================
 #
-# Version 3.2.0beta0, released 17 Jan 2009.
+# Version 3.2.0beta0, released 5 April 2009.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -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")