/[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 34 by dpavlin, Sun Jul 31 20:53:40 2005 UTC revision 35 by dpavlin, Sun Jul 31 21:03:36 2005 UTC
# Line 204  foreach my $host_key (keys %{$hosts}) { Line 204  foreach my $host_key (keys %{$hosts}) {
204                          print "\t$share";                          print "\t$share";
205                          $shareID = getShareID($share, $hostID, $hostname);                          $shareID = getShareID($share, $hostID, $hostname);
206                                    
207                          my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, \@backups, $backupNum, $share, "", $shareID);                          my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
208                          print " $nf/$f files $nd/$d dirs\n";                          print " $nf/$f files $nd/$d dirs\n";
209                          $dbh->commit();                          $dbh->commit();
210                  }                  }
# Line 276  sub found_in_db { Line 276  sub found_in_db {
276  ####################################################  ####################################################
277  sub recurseDir($$$$$$$$) {  sub recurseDir($$$$$$$$) {
278    
279          my ($bpc, $hostname, $backups, $backupNum, $share, $dir, $shareID) = @_;          my ($bpc, $hostname, $files, $backupNum, $share, $dir, $shareID) = @_;
280    
281          print STDERR "recurse($hostname,$backupNum,$share,$dir,$shareID)\n" if ($debug >= 1);          print STDERR "recurse($hostname,$backupNum,$share,$dir,$shareID)\n" if ($debug >= 1);
282    
# Line 285  sub recurseDir($$$$$$$$) { Line 285  sub recurseDir($$$$$$$$) {
285          { # scope          { # scope
286                  my @stack;                  my @stack;
287    
                 my $files = BackupPC::View->new($bpc, $hostname, $backups, 1);  
288                  my $filesInBackup = $files->dirAttrib($backupNum, $share, $dir);                  my $filesInBackup = $files->dirAttrib($backupNum, $share, $dir);
289    
290                  # first, add all the entries in current directory                  # first, add all the entries in current directory
# Line 346  sub recurseDir($$$$$$$$) { Line 345  sub recurseDir($$$$$$$$) {
345                  print STDERR "## STACK ",join(", ", @stack),"\n" if ($debug >= 2);                  print STDERR "## STACK ",join(", ", @stack),"\n" if ($debug >= 2);
346    
347                  while ( my $dir = shift @stack ) {                  while ( my $dir = shift @stack ) {
348                          my ($f,$nf,$d,$nd) = recurseDir($bpc, $hostname, $backups, $backupNum, $share, $dir, $shareID);                          my ($f,$nf,$d,$nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, $dir, $shareID);
349                          print STDERR "# $dir f: $f nf: $nf d: $d nd: $nd\n" if ($debug >= 1);                          print STDERR "# $dir f: $f nf: $nf d: $d nd: $nd\n" if ($debug >= 1);
350                          $nr_files += $f;                          $nr_files += $f;
351                          $new_files += $nf;                          $new_files += $nf;

Legend:
Removed from v.34  
changed lines
  Added in v.35

  ViewVC Help
Powered by ViewVC 1.1.26