--- trunk/bin/BackupPC_updatedb 2005/08/20 15:01:48 49 +++ trunk/bin/BackupPC_updatedb 2005/08/20 15:51:16 50 @@ -198,6 +198,15 @@ VALUES (?,?,?,?,?,?,?,?) }); +sub fmt_time { + my $t = shift || return; + my $out = ""; + my ($ss,$mm,$hh) = gmtime($t); + $out .= "${hh}h" if ($hh); + $out .= sprintf("%02d:%02d", $mm,$ss); + return $out; +} + foreach my $host_key (keys %{$hosts}) { my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key"; @@ -255,9 +264,11 @@ $shareID = getShareID($share, $hostID, $hostname); my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); - printf(" %d/%d files %d/%d dirs [%.2f/s]\n", + my $dur = (time() - $t) || 1; + printf(" %d/%d files %d/%d dirs [%.2f/s dur: %s]\n", $nf, $f, $nd, $d, - ( ($f+$d) / ((time() - $t) || 1) ) + ( ($f+$d) / $dur ), + fmt_time($dur) ); $dbh->commit(); }