/[BackupPC]/trunk/bin/BackupPC_updatedb
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_updatedb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 66 by dpavlin, Mon Aug 22 00:09:59 2005 UTC revision 67 by dpavlin, Mon Aug 22 08:58:59 2005 UTC
# Line 223  foreach my $host_key (keys %{$hosts}) { Line 223  foreach my $host_key (keys %{$hosts}) {
223                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);
224          }          }
225    
226          print("host ".$hosts->{$host_key}->{'host'}.": ");          print "host ".$hosts->{$host_key}->{'host'}.": ";
227    
228          # get backups for a host          # get backups for a host
229          my @backups = $bpc->BackupInfoRead($hostname);          my @backups = $bpc->BackupInfoRead($hostname);
230          print scalar @backups, " increments\n";          my $incs = scalar @backups;
231            print  "$incs increments\n";
232    
233          my $inc_nr = 0;          my $inc_nr = 0;
234            $beenThere = {};
235    
236          foreach my $backup (@backups) {          foreach my $backup (@backups) {
237    
# Line 239  foreach my $host_key (keys %{$hosts}) { Line 241  foreach my $host_key (keys %{$hosts}) {
241                  my $backupNum = $backup->{'num'};                  my $backupNum = $backup->{'num'};
242                  my @backupShares = ();                  my @backupShares = ();
243    
244                  print $hosts->{$host_key}->{'host'},                  printf("%-10s %2d/%-2d #%-2d %s %5s/%5s files (date: %s dur: %s)\n",
245                          "\t#$backupNum\t", $backup->{type} || '?', " ",                          $hosts->{$host_key}->{'host'},
246                          $backup->{nFilesNew} || '?', "/", $backup->{nFiles} || '?',                          $inc_nr, $incs, $backupNum,
247                          " files (date: ",                          $backup->{type} || '?',
248                            $backup->{nFilesNew} || '?', $backup->{nFiles} || '?',
249                          strftime($t_fmt,localtime($backup->{startTime})),                          strftime($t_fmt,localtime($backup->{startTime})),
250                          " dur: ",                          fmt_time($backup->{endTime} - $backup->{startTime})
251                          fmt_time($backup->{endTime} - $backup->{startTime}),                  );
                         ")\n";  
252    
253                  my $files = BackupPC::View->new($bpc, $hostname, \@backups, 1);                  my $files = BackupPC::View->new($bpc, $hostname, \@backups, 1);
254                  foreach my $share ($files->shareList($backupNum)) {                  foreach my $share ($files->shareList($backupNum)) {
# Line 336  sub found_in_db { Line 338  sub found_in_db {
338                  SELECT 1 FROM files                  SELECT 1 FROM files
339                  WHERE shareID = ? and                  WHERE shareID = ? and
340                          path = ? and                          path = ? and
                         name = ? and  
341                          date = ? and                          date = ? and
342                          size = ?                          size = ?
343          });          });
344    
345          my @param = ($shareID,$path,$name,$date,$size);          my @param = ($shareID,$path,$date,$size);
346          $sth->{file_in_db}->execute(@param);          $sth->{file_in_db}->execute(@param);
347          my $rows = $sth->{file_in_db}->rows;          my $rows = $sth->{file_in_db}->rows;
348          print STDERR "## found_in_db ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);          print STDERR "## found_in_db ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);

Legend:
Removed from v.66  
changed lines
  Added in v.67

  ViewVC Help
Powered by ViewVC 1.1.26