/[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 246 by dpavlin, Fri Dec 9 12:49:55 2005 UTC revision 249 by dpavlin, Fri Dec 9 16:27:49 2005 UTC
# Line 121  sub hest_update { Line 121  sub hest_update {
121    
122          my $skip_check = $opt{j} && print STDERR "Skipping check for existing files -- this should be used only with initital import\n";          my $skip_check = $opt{j} && print STDERR "Skipping check for existing files -- this should be used only with initital import\n";
123    
124          unless ($use_hest) {          unless (defined($use_hest)) {
125                  print STDERR "HyperEstraier support not enabled in configuration\n";                  print STDERR "HyperEstraier support not enabled in configuration\n";
126                    $use_hest = 0;
127                  return;                  return;
128          }          }
129    
130            return unless($use_hest);
131    
132          print curr_time," updating HyperEstraier:";          print curr_time," updating HyperEstraier:";
133    
134          my $t = time();          my $t = time();
# Line 458  INSERT INTO files Line 461  INSERT INTO files
461          VALUES (?,?,?,?,?,?,?)          VALUES (?,?,?,?,?,?,?)
462  });  });
463    
464  foreach my $host_key (keys %{$hosts}) {  my @hosts = keys %{$hosts};
465    my $host_nr = 0;
466    
467    foreach my $host_key (@hosts) {
468    
469          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";
470    
# Line 473  foreach my $host_key (keys %{$hosts}) { Line 479  foreach my $host_key (keys %{$hosts}) {
479                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);
480          }          }
481    
482          print "host ".$hosts->{$host_key}->{'host'}.": ";          $host_nr++;
483            print "host ", $hosts->{$host_key}->{'host'}, " [",
484                    $host_nr, "/", ($#hosts + 1), "]: ";
485    
486          # get backups for a host          # get backups for a host
487          my @backups = $bpc->BackupInfoRead($hostname);          my @backups = $bpc->BackupInfoRead($hostname);

Legend:
Removed from v.246  
changed lines
  Added in v.249

  ViewVC Help
Powered by ViewVC 1.1.26