198 |
VALUES (?,?,?,?,?,?,?,?) |
VALUES (?,?,?,?,?,?,?,?) |
199 |
}); |
}); |
200 |
|
|
201 |
|
sub fmt_time { |
202 |
|
my $t = shift || return; |
203 |
|
my $out = ""; |
204 |
|
my ($ss,$mm,$hh) = gmtime($t); |
205 |
|
$out .= "${hh}h" if ($hh); |
206 |
|
$out .= sprintf("%02d:%02d", $mm,$ss); |
207 |
|
return $out; |
208 |
|
} |
209 |
|
|
210 |
foreach my $host_key (keys %{$hosts}) { |
foreach my $host_key (keys %{$hosts}) { |
211 |
|
|
212 |
my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key"; |
my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key"; |
264 |
$shareID = getShareID($share, $hostID, $hostname); |
$shareID = getShareID($share, $hostID, $hostname); |
265 |
|
|
266 |
my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); |
my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); |
267 |
printf(" %d/%d files %d/%d dirs [%.2f/s]\n", |
my $dur = (time() - $t) || 1; |
268 |
|
printf(" %d/%d files %d/%d dirs [%.2f/s dur: %s]\n", |
269 |
$nf, $f, $nd, $d, |
$nf, $f, $nd, $d, |
270 |
( ($f+$d) / ((time() - $t) || 1) ) |
( ($f+$d) / $dur ), |
271 |
|
fmt_time($dur) |
272 |
); |
); |
273 |
$dbh->commit(); |
$dbh->commit(); |
274 |
} |
} |