-#!/bin/perl
+#!/usr/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_dump: Dump a single client.
# 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
#
#========================================================================
#
-# Version 3.2.0beta0, released 17 Jan 2009.
+# Version 3.2.0, released 31 Jul 2010.
#
# See http://backuppc.sourceforge.net.
#
|| !defined($p->{hourBegin})
|| !defined($p->{hourEnd})
);
+ my $matchWday = $wday;
if ( $p->{hourBegin} > $p->{hourEnd} ) {
$blackout = $p->{hourBegin} <= $currHours
|| $currHours <= $p->{hourEnd};
# 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")
#
# Now backup each of the shares
#
+my $shareDuplicate = {};
for my $shareName ( @$ShareNames ) {
local(*RH, *WH);
$shareName = encode("utf8", $shareName);
$stat{xferOK} = $stat{hostAbort} = undef;
$stat{hostError} = $stat{lastOutputLine} = undef;
- if ( -d "$Dir/new/$shareName" ) {
+ if ( $shareName eq "" ) {
+ print(LOG $bpc->timeStamp,
+ "unexpected empty share name skipped\n");
+ next;
+ }
+ if ( $shareDuplicate->{$shareName} ) {
print(LOG $bpc->timeStamp,
"unexpected repeated share name $shareName skipped\n");
next;
}
+ $shareDuplicate->{$shareName} = 1;
UserCommandRun("DumpPreShareCmd", $shareName);
if ( $? && $Conf{UserCmdCheckStatus} ) {
#
last;
}
+ #
+ # Wait for any child processes to exit
+ #
+ # 1 while ( wait() >= 0 );
}
#