--- trunk/bin/BackupPC_updatedb 2005/08/22 00:09:59 66 +++ trunk/bin/BackupPC_updatedb 2005/08/22 08:58:59 67 @@ -223,13 +223,15 @@ $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef); } - print("host ".$hosts->{$host_key}->{'host'}.": "); + print "host ".$hosts->{$host_key}->{'host'}.": "; # get backups for a host my @backups = $bpc->BackupInfoRead($hostname); - print scalar @backups, " increments\n"; + my $incs = scalar @backups; + print "$incs increments\n"; my $inc_nr = 0; + $beenThere = {}; foreach my $backup (@backups) { @@ -239,14 +241,14 @@ my $backupNum = $backup->{'num'}; my @backupShares = (); - print $hosts->{$host_key}->{'host'}, - "\t#$backupNum\t", $backup->{type} || '?', " ", - $backup->{nFilesNew} || '?', "/", $backup->{nFiles} || '?', - " files (date: ", + printf("%-10s %2d/%-2d #%-2d %s %5s/%5s files (date: %s dur: %s)\n", + $hosts->{$host_key}->{'host'}, + $inc_nr, $incs, $backupNum, + $backup->{type} || '?', + $backup->{nFilesNew} || '?', $backup->{nFiles} || '?', strftime($t_fmt,localtime($backup->{startTime})), - " dur: ", - fmt_time($backup->{endTime} - $backup->{startTime}), - ")\n"; + fmt_time($backup->{endTime} - $backup->{startTime}) + ); my $files = BackupPC::View->new($bpc, $hostname, \@backups, 1); foreach my $share ($files->shareList($backupNum)) { @@ -336,12 +338,11 @@ SELECT 1 FROM files WHERE shareID = ? and path = ? and - name = ? and date = ? and size = ? }); - my @param = ($shareID,$path,$name,$date,$size); + my @param = ($shareID,$path,$date,$size); $sth->{file_in_db}->execute(@param); my $rows = $sth->{file_in_db}->rows; print STDERR "## found_in_db ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);