$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) {
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)) {
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);