82 |
my $in_backup_increment; |
my $in_backup_increment; |
83 |
|
|
84 |
|
|
85 |
if ( !getopts("th:n:p:r:s:b:w:", \%opts) ) { |
if ( !getopts("th:n:p:r:s:b:w:v", \%opts) ) { |
86 |
print STDERR <<EOF; |
print STDERR <<EOF; |
87 |
usage: $0 [options] |
usage: $0 [options] |
88 |
Required options: |
Required options: |
98 |
-p pathAdd new path prefix |
-p pathAdd new path prefix |
99 |
-b BLOCKS BLOCKS x 512 bytes per record (default 20; same as tar) |
-b BLOCKS BLOCKS x 512 bytes per record (default 20; same as tar) |
100 |
-w writeBufSz write buffer size (default 1048576 = 1MB) |
-w writeBufSz write buffer size (default 1048576 = 1MB) |
101 |
|
-v verbose output |
102 |
EOF |
EOF |
103 |
exit(1); |
exit(1); |
104 |
} |
} |
392 |
my $dsn = $Conf{SearchDSN}; |
my $dsn = $Conf{SearchDSN}; |
393 |
my $db_user = $Conf{SearchUser} || ''; |
my $db_user = $Conf{SearchUser} || ''; |
394 |
|
|
395 |
print STDERR curr_time(), "getting files for $host:$share increment $dumpNo..."; |
print STDERR curr_time(), "getting files for $host:$share increment $dumpNo..." if ($opts{v}); |
396 |
my $sql = q{ |
my $sql = q{ |
397 |
SELECT path |
SELECT path |
398 |
FROM files |
FROM files |
405 |
my $sth = $dbh->prepare($sql); |
my $sth = $dbh->prepare($sql); |
406 |
$sth->execute($host, $share, $dumpNo); |
$sth->execute($host, $share, $dumpNo); |
407 |
my $count = $sth->rows; |
my $count = $sth->rows; |
408 |
print STDERR " found $count items\n"; |
print STDERR " found $count items\n" if ($opts{v}); |
409 |
while (my $row = $sth->fetchrow_arrayref) { |
while (my $row = $sth->fetchrow_arrayref) { |
410 |
print STDERR "+ ", $row->[0],"\n"; |
#print STDERR "+ ", $row->[0],"\n"; |
411 |
$in_backup_increment->{ $row->[0] }++; |
$in_backup_increment->{ $row->[0] }++; |
412 |
} |
} |
413 |
|
|
431 |
|
|
432 |
#print STDERR "? $tarPath\n"; |
#print STDERR "? $tarPath\n"; |
433 |
return unless ($in_backup_increment->{$tarPath}); |
return unless ($in_backup_increment->{$tarPath}); |
434 |
print STDERR "A $tarPath\n"; |
#print STDERR "A $tarPath\n"; |
435 |
|
|
436 |
if ( defined($PathRemove) |
if ( defined($PathRemove) |
437 |
&& substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) { |
&& substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) { |