13 |
use POSIX qw/strftime/; |
use POSIX qw/strftime/; |
14 |
|
|
15 |
use constant BPC_FTYPE_DIR => 5; |
use constant BPC_FTYPE_DIR => 5; |
16 |
use constant EST_CHUNK => 10000; |
use constant EST_CHUNK => 100000; |
17 |
|
|
18 |
my $debug = 0; |
my $debug = 0; |
19 |
$|=1; |
$|=1; |
117 |
$hest_db = HyperEstraier::Database->new(); |
$hest_db = HyperEstraier::Database->new(); |
118 |
$hest_db->open($index_path, $HyperEstraier::Database::DBWRITER | $HyperEstraier::Database::DBCREAT); |
$hest_db->open($index_path, $HyperEstraier::Database::DBWRITER | $HyperEstraier::Database::DBCREAT); |
119 |
|
|
120 |
|
print " increment is " . EST_CHUNK . " files"; |
121 |
|
|
122 |
my $results = 0; |
my $results = 0; |
123 |
|
|
124 |
do { |
do { |
125 |
|
|
126 |
my $where = ''; |
my $where = ''; |
127 |
|
my @data; |
128 |
if ($host_id && $share_id && $num) { |
if ($host_id && $share_id && $num) { |
129 |
$where = qq{ |
$where = qq{ |
130 |
WHERE |
WHERE |
132 |
shares.id = ? AND |
shares.id = ? AND |
133 |
files.backupnum = ? |
files.backupnum = ? |
134 |
}; |
}; |
135 |
|
@data = ( $host_id, $share_id, $num ); |
136 |
} |
} |
137 |
|
|
138 |
my $limit = sprintf('LIMIT '.EST_CHUNK.' OFFSET %d', $offset); |
my $limit = sprintf('LIMIT '.EST_CHUNK.' OFFSET %d', $offset); |
159 |
$limit |
$limit |
160 |
}); |
}); |
161 |
|
|
162 |
$sth->execute(@_); |
$sth->execute(@data); |
163 |
$results = $sth->rows; |
$results = $sth->rows; |
164 |
|
|
165 |
if ($results == 0) { |
if ($results == 0) { |