204 |
print "\t$share"; |
print "\t$share"; |
205 |
$shareID = getShareID($share, $hostID, $hostname); |
$shareID = getShareID($share, $hostID, $hostname); |
206 |
|
|
207 |
my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, \@backups, $backupNum, $share, "", $shareID); |
my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); |
208 |
print " $nf/$f files $nd/$d dirs\n"; |
print " $nf/$f files $nd/$d dirs\n"; |
209 |
$dbh->commit(); |
$dbh->commit(); |
210 |
} |
} |
276 |
#################################################### |
#################################################### |
277 |
sub recurseDir($$$$$$$$) { |
sub recurseDir($$$$$$$$) { |
278 |
|
|
279 |
my ($bpc, $hostname, $backups, $backupNum, $share, $dir, $shareID) = @_; |
my ($bpc, $hostname, $files, $backupNum, $share, $dir, $shareID) = @_; |
280 |
|
|
281 |
print STDERR "recurse($hostname,$backupNum,$share,$dir,$shareID)\n" if ($debug >= 1); |
print STDERR "recurse($hostname,$backupNum,$share,$dir,$shareID)\n" if ($debug >= 1); |
282 |
|
|
285 |
{ # scope |
{ # scope |
286 |
my @stack; |
my @stack; |
287 |
|
|
|
my $files = BackupPC::View->new($bpc, $hostname, $backups, 1); |
|
288 |
my $filesInBackup = $files->dirAttrib($backupNum, $share, $dir); |
my $filesInBackup = $files->dirAttrib($backupNum, $share, $dir); |
289 |
|
|
290 |
# first, add all the entries in current directory |
# first, add all the entries in current directory |
345 |
print STDERR "## STACK ",join(", ", @stack),"\n" if ($debug >= 2); |
print STDERR "## STACK ",join(", ", @stack),"\n" if ($debug >= 2); |
346 |
|
|
347 |
while ( my $dir = shift @stack ) { |
while ( my $dir = shift @stack ) { |
348 |
my ($f,$nf,$d,$nd) = recurseDir($bpc, $hostname, $backups, $backupNum, $share, $dir, $shareID); |
my ($f,$nf,$d,$nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, $dir, $shareID); |
349 |
print STDERR "# $dir f: $f nf: $nf d: $d nd: $nd\n" if ($debug >= 1); |
print STDERR "# $dir f: $f nf: $nf d: $d nd: $nd\n" if ($debug >= 1); |
350 |
$nr_files += $f; |
$nr_files += $f; |
351 |
$new_files += $nf; |
$new_files += $nf; |