/[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 131 by dpavlin, Fri Sep 23 08:54:11 2005 UTC revision 305 by dpavlin, Sat Jan 28 19:49:18 2006 UTC
# Line 12  use Time::HiRes qw/time/; Line 12  use Time::HiRes qw/time/;
12  use File::Pid;  use File::Pid;
13  use POSIX qw/strftime/;  use POSIX qw/strftime/;
14  use BackupPC::SearchLib;  use BackupPC::SearchLib;
15    use Cwd qw/abs_path/;
16    
17  use constant BPC_FTYPE_DIR => 5;  use constant BPC_FTYPE_DIR => 5;
18  use constant EST_CHUNK => 100000;  use constant EST_CHUNK => 100000;
19    
20    # daylight saving time change offset for 1h
21    my $dst_offset = 60 * 60;
22    
23  my $debug = 0;  my $debug = 0;
24  $|=1;  $|=1;
25    
26  my $start_t = time();  my $start_t = time();
27    
28  my $pidfile = new File::Pid;  my $pid_path = abs_path($0);
29    $pid_path =~ s/\W+/_/g;
30    
31    my $pidfile = new File::Pid({
32            file => "/tmp/$pid_path",
33    });
34    
35  if (my $pid = $pidfile->running ) {  if (my $pid = $pidfile->running ) {
36          die "$0 already running: $pid\n";          die "$0 already running: $pid\n";
# Line 29  if (my $pid = $pidfile->running ) { Line 38  if (my $pid = $pidfile->running ) {
38          $pidfile->remove;          $pidfile->remove;
39          $pidfile = new File::Pid;          $pidfile = new File::Pid;
40  }  }
 $pidfile->write;  
41  print STDERR "$0 using pid ",$pidfile->pid," file ",$pidfile->file,"\n";  print STDERR "$0 using pid ",$pidfile->pid," file ",$pidfile->file,"\n";
42    $pidfile->write;
43    
44  my $t_fmt = '%Y-%m-%d %H:%M:%S';  my $t_fmt = '%Y-%m-%d %H:%M:%S';
45    
# Line 43  my $beenThere = {}; Line 52  my $beenThere = {};
52  my $dsn = $Conf{SearchDSN} || die "Need SearchDSN in config.pl\n";  my $dsn = $Conf{SearchDSN} || die "Need SearchDSN in config.pl\n";
53  my $user = $Conf{SearchUser} || '';  my $user = $Conf{SearchUser} || '';
54    
55  my $use_hest = $Conf{HyperEstraierIndex};  my $index_node_url = $Conf{HyperEstraierIndex};
 my ($index_path, $index_node_url) = BackupPC::SearchLib::getHyperEstraier_url($use_hest);  
56    
57  my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 });  my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 });
58    
59  my %opt;  my %opt;
60    
61  if ( !getopts("cdm:v:ij", \%opt ) ) {  if ( !getopts("cdm:v:ijf", \%opt ) ) {
62          print STDERR <<EOF;          print STDERR <<EOF;
63  usage: $0 [-c|-d] [-m num] [-v|-v level] [-i]  usage: $0 [-c|-d] [-m num] [-v|-v level] [-i|-j|-f]
64    
65  Options:  Options:
66          -c      create database on first use          -c      create database on first use
# Line 61  Options: Line 69  Options:
69          -v num  set verbosity (debug) level (default $debug)          -v num  set verbosity (debug) level (default $debug)
70          -i      update Hyper Estraier full text index          -i      update Hyper Estraier full text index
71          -j      update full text, don't check existing files          -j      update full text, don't check existing files
72            -f      don't do anything with full text index
73    
74  Option -j is variation on -i. It will allow faster initial creation  Option -j is variation on -i. It will allow faster initial creation
75  of full-text index from existing database.  of full-text index from existing database.
76    
77    Option -f will create database which is out of sync with full text index. You
78    will have to re-run $0 with -i to fix it.
79    
80  EOF  EOF
81          exit 1;          exit 1;
82  }  }
# Line 72  EOF Line 84  EOF
84  if ($opt{v}) {  if ($opt{v}) {
85          print "Debug level at $opt{v}\n";          print "Debug level at $opt{v}\n";
86          $debug = $opt{v};          $debug = $opt{v};
87    } elsif ($opt{f}) {
88            print "WARNING: disabling full-text index update. You need to re-run $0 -j !\n";
89            $index_node_url = undef;
90  }  }
91    
92  #---- subs ----  #---- subs ----
# Line 111  sub hest_update { Line 126  sub hest_update {
126    
127          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";
128    
129          unless ($use_hest) {          unless (defined($index_node_url)) {
130                  print STDERR "HyperEstraier support not enabled in configuration\n";                  print STDERR "HyperEstraier support not enabled in configuration\n";
131                    $index_node_url = 0;
132                  return;                  return;
133          }          }
134    
135          print curr_time," updating HyperEstraier:";          print curr_time," updating Hyper Estraier:";
136    
137          my $t = time();          my $t = time();
138    
139          my $offset = 0;          my $offset = 0;
140          my $added = 0;          my $added = 0;
141    
142          print " opening index $use_hest";          print " opening index $index_node_url";
143          if ($index_path) {          if ($index_node_url) {
144                  $hest_db = HyperEstraier::Database->new();                  $hest_node ||= Search::Estraier::Node->new($index_node_url);
                 $hest_db->open($TopDir . $index_path, $HyperEstraier::Database::DBWRITER | $HyperEstraier::Database::DBCREAT);  
                 print " directly";  
         } elsif ($index_node_url) {  
                 $hest_node ||= HyperEstraier::Node->new($index_node_url);  
145                  $hest_node->set_auth('admin', 'admin');                  $hest_node->set_auth('admin', 'admin');
146                  print " via node URL";                  print " via node URL";
147          } else {          } else {
148                  die "don't know how to use HyperEstraier Index $use_hest";                  die "don't know how to use Hyper Estraier Index $index_node_url";
149          }          }
         print " increment is " . EST_CHUNK . " files:";  
150    
151          my $results = 0;          my $results = 0;
152    
# Line 143  sub hest_update { Line 154  sub hest_update {
154    
155                  my $where = '';                  my $where = '';
156                  my @data;                  my @data;
157                  if ($host_id && $share_id && $num) {                  if (defined($host_id) && defined($share_id) && defined($num)) {
158                          $where = qq{                          $where = qq{
159                          WHERE                          WHERE
160                                  hosts.id = ? AND                                  hosts.id = ? AND
# Line 183  sub hest_update { Line 194  sub hest_update {
194                  if ($results == 0) {                  if ($results == 0) {
195                          print " - no new files\n";                          print " - no new files\n";
196                          last;                          last;
197                    } else {
198                            print " - $results files: ";
199                  }                  }
200    
201                  sub fmt_date {                  sub fmt_date {
# Line 203  sub hest_update { Line 216  sub hest_update {
216                          }                          }
217    
218                          # create a document object                          # create a document object
219                          my $doc = HyperEstraier::Document->new;                          my $doc = Search::Estraier::Document->new;
220    
221                          # add attributes to the document object                          # add attributes to the document object
222                          $doc->add_attr('@uri', $uri);                          $doc->add_attr('@uri', $uri);
223    
224                          foreach my $c (@{ $sth->{NAME} }) {                          foreach my $c (@{ $sth->{NAME} }) {
225                                  $doc->add_attr($c, $row->{$c}) if ($row->{$c});                                  print STDERR "attr $c = $row->{$c}\n" if ($debug > 2);
226                                    $doc->add_attr($c, $row->{$c}) if (defined($row->{$c}));
227                          }                          }
228    
229                          #$doc->add_attr('@cdate', fmt_date($row->{'date'}));                          #$doc->add_attr('@cdate', fmt_date($row->{'date'}));
# Line 223  sub hest_update { Line 237  sub hest_update {
237                          print STDERR $doc->dump_draft,"\n" if ($debug > 1);                          print STDERR $doc->dump_draft,"\n" if ($debug > 1);
238    
239                          # register the document object to the database                          # register the document object to the database
240                          if ($hest_db) {                          if ($hest_node) {
                                 $hest_db->put_doc($doc, $HyperEstraier::Database::PDCLEAN);  
                         } elsif ($hest_node) {  
241                                  $hest_node->put_doc($doc);                                  $hest_node->put_doc($doc);
242                          } else {                          } else {
243                                  die "not supported";                                  die "not supported";
# Line 234  sub hest_update { Line 246  sub hest_update {
246                  }                  }
247    
248                  print " $added";                  print " $added";
                 $hest_db->sync() if ($index_path);  
249    
250                  $offset += EST_CHUNK;                  $offset += EST_CHUNK;
251    
252          } while ($results == EST_CHUNK);          } while ($results == EST_CHUNK);
253    
         if ($index_path) {  
                 print ", close";  
                 $hest_db->close();  
         }  
   
254          my $dur = (time() - $t) || 1;          my $dur = (time() - $t) || 1;
255          printf(" [%.2f/s dur: %s]\n",          printf(" [%.2f/s dur: %s]\n",
256                  ( $added / $dur ),                  ( $added / $dur ),
# Line 256  sub hest_update { Line 262  sub hest_update {
262    
263    
264  ## update index ##  ## update index ##
265  if (($opt{i} || $opt{j} || ($index_path && ! -e $index_path)) && !$opt{c}) {  if ( ( $opt{i} || $opt{j} ) && !$opt{c} ) {
266          # update all          # update all
267          print "force update of HyperEstraier index ";          print "force update of Hyper Estraier index ";
         print "importing existing data" unless (-e $index_path);  
268          print "by -i flag" if ($opt{i});          print "by -i flag" if ($opt{i});
269          print "by -j flag" if ($opt{j});          print "by -j flag" if ($opt{j});
270          print "\n";          print "\n";
# Line 270  if (($opt{i} || $opt{j} || ($index_path Line 275  if (($opt{i} || $opt{j} || ($index_path
275  if ($opt{c}) {  if ($opt{c}) {
276          sub do_index {          sub do_index {
277                  my $index = shift || return;                  my $index = shift || return;
278                  my ($table,$col,$unique) = split(/_/, $index);                  my ($table,$col,$unique) = split(/:/, $index);
279                  $unique ||= '';                  $unique ||= '';
280                  $index =~ s/,/_/g;                  $index =~ s/\W+/_/g;
281                    print "$index on $table($col)" . ( $unique ? "u" : "" ) . " ";
282                  $dbh->do(qq{ create $unique index $index on $table($col) });                  $dbh->do(qq{ create $unique index $index on $table($col) });
283          }          }
284    
285          print "creating tables...\n";          print "creating tables...\n";
286          
287          $dbh->do(qq{          $dbh->do( qq{
288                  create table hosts (                  create table hosts (
289                          ID      SERIAL          PRIMARY KEY,                          ID      SERIAL          PRIMARY KEY,
290                          name    VARCHAR(30)     NOT NULL,                          name    VARCHAR(30)     NOT NULL,
291                          IP      VARCHAR(15)                          IP      VARCHAR(15)
292                  );                              );            
293          });  
                 
         $dbh->do(qq{  
294                  create table shares (                  create table shares (
295                          ID      SERIAL          PRIMARY KEY,                          ID      SERIAL          PRIMARY KEY,
296                          hostID  INTEGER         NOT NULL references hosts(id),                          hostID  INTEGER         NOT NULL references hosts(id),
297                          name    VARCHAR(30)     NOT NULL,                          name    VARCHAR(30)     NOT NULL,
298                          share   VARCHAR(200)    NOT NULL,                          share   VARCHAR(200)    NOT NULL
                         localpath VARCHAR(200)        
299                  );                              );            
         });  
300    
         $dbh->do(qq{  
301                  create table dvds (                  create table dvds (
302                          ID      SERIAL          PRIMARY KEY,                          ID      SERIAL          PRIMARY KEY,
303                          num     INTEGER         NOT NULL,                          num     INTEGER         NOT NULL,
304                          name    VARCHAR(255)    NOT NULL,                          name    VARCHAR(255)    NOT NULL,
305                          mjesto  VARCHAR(255)                          mjesto  VARCHAR(255)
306                  );                  );
307          });  
           
         $dbh->do(qq{  
308                  create table backups (                  create table backups (
309                            id      serial,
310                          hostID  INTEGER         NOT NULL references hosts(id),                          hostID  INTEGER         NOT NULL references hosts(id),
311                          num     INTEGER         NOT NULL,                          num     INTEGER         NOT NULL,
312                          date    integer         NOT NULL,                          date    integer         NOT NULL,
313                          type    CHAR(4)         not null,                          type    CHAR(4)         not null,
314                          shareID integer         not null references shares(id),                          shareID integer         not null references shares(id),
315                          size    integer         not null,                          size    bigint          not null,
316                          PRIMARY KEY(hostID, num, shareID)                          inc_size bigint         not null default -1,
317                            inc_deleted boolean     default false,
318                            parts   integer         not null default 1,
319                            PRIMARY KEY(id)
320                  );                              );            
         });  
   
         #do_index('backups_hostid,num_unique');  
   
321    
         $dbh->do(qq{      
322                  create table files (                  create table files (
323                          ID      SERIAL          PRIMARY KEY,                            ID              SERIAL,
324                          shareID INTEGER         NOT NULL references shares(id),                          shareID         INTEGER NOT NULL references shares(id),
325                          backupNum  INTEGER      NOT NULL,                          backupNum       INTEGER NOT NULL,
326                          name       VARCHAR(255) NOT NULL,                          name            VARCHAR(255) NOT NULL,
327                          path       VARCHAR(255) NOT NULL,                          path            VARCHAR(255) NOT NULL,
328                          date       integer      NOT NULL,                          date            integer NOT NULL,
329                          type       INTEGER      NOT NULL,                          type            INTEGER NOT NULL,
330                          size       INTEGER      NOT NULL                          size            bigint  NOT NULL,
331                            primary key(id)
332                  );                  );
         });  
   
333    
334          $dbh->do( qq{                  create table archive (
335                  create table archive                          id              serial,
                 (  
                         id                      int not null,  
336                          dvd_nr          int not null,                          dvd_nr          int not null,
337                            total_size      bigint default -1,
338                          note            text,                          note            text,
339                          username        varchar(20) not null,                          username        varchar(20) not null,
340                          date            timestamp,                          date            timestamp default now(),
341                          primary key(id)                          primary key(id)
342                  );                        );      
         }  
         );  
343    
344          $dbh->do( qq{                  create table archive_backup (
345                  create table archive_backup                          archive_id      int not null references archive(id) on delete cascade,
346                  (                          backup_id       int not null references backups(id),
                         archive_id      int not null,  
                         backup_id       int not null,  
                         status          text,  
347                          primary key(archive_id, backup_id)                          primary key(archive_id, backup_id)
348                  );                  );
         });  
   
         $dbh->do( qq{  
                 create table workflows(  
                         id                      int not null,  
                         step_id         int not null,  
                         start           timestamp,  
                         stop            timestamp,  
                         username        varchar(20),  
                         archive_id      int not null,  
                         running         boolean default true,  
                         primary key(id)  
                 );  
         });  
349    
350          $dbh->do( qq{                  create table archive_burned (
351                  create table workflow_step                          archive_id      int references archive(id),
352                  (                          date            timestamp default now(),
353                          step_id         int not null,                          part            int not null default 1,
354                          code            text,                          copy            int not null default 1,
355                          next_step       int,                          iso_size bigint default -1
                         stop            boolean default false,  
                         primary key(step_id)  
356                  );                  );
         });  
   
         $dbh->do( qq{  
                         alter table workflow_step  
                                 add constraint fk_workflow_next_step  
                                 foreign key(next_step)  
                                 references workflow_step(step_id);  
         });  
357    
358          $dbh->do( qq{                  create table backup_parts (
359                  alter table workflows                          id serial,
360                          add constraint fk_workflows_step_id                          backup_id int references backups(id),
361                          foreign key(step_id)                          part_nr int not null check (part_nr > 0),
362                          references workflow_step(step_id);                          tar_size bigint not null check (tar_size > 0),
363          });                          size bigint not null check (size > 0),
364                                    md5 text not null,
365          $dbh->do( qq{                          items int not null check (items > 0),
366                  alter table workflows                          date timestamp default now(),
367                          add constraint fk_workflows_archive_id                          primary key(id)
                         foreign key(archive_id)  
                         references archive(id);  
         });  
   
         $dbh->do( qq{  
                 create table workflow_log  
                 (  
                         workflow_id             int not null,  
                         step_id                 int not null,  
                         date                    timestamp not null,  
                         status                  text,  
                         primary key(workflow_id, step_id)  
368                  );                  );
369          });          });
370    
371          $dbh->do( qq{          print "creating indexes: ";
                 alter table workflow_log  
                         add constraint fk_workflow_log_workflow_id  
                         foreign key (workflow_id)  
                         references workflows(id);  
                 });  
           
         $dbh->do( qq{  
                 alter table workflow_log  
                         add constraint fk_workflow_log_step_id  
                         foreign key (step_id)  
                         references      workflow_step(step_id);  
                 });  
   
         print "creating indexes:";  
372    
373          foreach my $index (qw(          foreach my $index (qw(
374                  hosts_name                  hosts:name
375                  backups_hostID                  backups:hostID
376                  backups_num                  backups:num
377                  shares_hostID                  backups:shareID
378                  shares_name                  shares:hostID
379                  files_shareID                  shares:name
380                  files_path                  files:shareID
381                  files_name                  files:path
382                  files_date                  files:name
383                  files_size                  files:date
384                    files:size
385                    archive:dvd_nr
386                    archive_burned:archive_id
387                    backup_parts:backup_id,part_nr
388          )) {          )) {
                 print " $index";  
389                  do_index($index);                  do_index($index);
390          }          }
391    
392            print " creating sequence: ";
393            foreach my $seq (qw/dvd_nr/) {
394                    print "$seq ";
395                    $dbh->do( qq{ CREATE SEQUENCE $seq } );
396            }
397    
398    
399          print "...\n";          print "...\n";
400    
401          $dbh->commit;          $dbh->commit;
# Line 487  WHERE hostID=? AND num=? AND shareid=? Line 439  WHERE hostID=? AND num=? AND shareid=?
439    
440  $sth->{insert_backups} = $dbh->prepare(qq{  $sth->{insert_backups} = $dbh->prepare(qq{
441  INSERT INTO backups (hostID, num, date, type, shareid, size)  INSERT INTO backups (hostID, num, date, type, shareid, size)
442  VALUES (?,?,?,?,?,?)  VALUES (?,?,?,?,?,-1)
443    });
444    
445    $sth->{update_backups_size} = $dbh->prepare(qq{
446    UPDATE backups SET size = ?
447    WHERE hostID = ? and num = ? and date = ? and type =? and shareid = ?
448  });  });
449    
450  $sth->{insert_files} = $dbh->prepare(qq{  $sth->{insert_files} = $dbh->prepare(qq{
# Line 496  INSERT INTO files Line 453  INSERT INTO files
453          VALUES (?,?,?,?,?,?,?)          VALUES (?,?,?,?,?,?,?)
454  });  });
455    
456  foreach my $host_key (keys %{$hosts}) {  my @hosts = keys %{$hosts};
457    my $host_nr = 0;
458    
459    foreach my $host_key (@hosts) {
460    
461          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";
462    
# Line 511  foreach my $host_key (keys %{$hosts}) { Line 471  foreach my $host_key (keys %{$hosts}) {
471                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);                  $hostID = $dbh->last_insert_id(undef,undef,'hosts',undef);
472          }          }
473    
474          print "host ".$hosts->{$host_key}->{'host'}.": ";          $host_nr++;
475            print "host ", $hosts->{$host_key}->{'host'}, " [",
476                    $host_nr, "/", ($#hosts + 1), "]: ";
477    
478          # get backups for a host          # get backups for a host
479          my @backups = $bpc->BackupInfoRead($hostname);          my @backups = $bpc->BackupInfoRead($hostname);
# Line 553  foreach my $host_key (keys %{$hosts}) { Line 515  foreach my $host_key (keys %{$hosts}) {
515                          # dump some log                          # dump some log
516                          print curr_time," ", $share;                          print curr_time," ", $share;
517    
                         my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);  
   
518                          $sth->{insert_backups}->execute(                          $sth->{insert_backups}->execute(
519                                  $hostID,                                  $hostID,
520                                  $backupNum,                                  $backupNum,
521                                  $backup->{'endTime'},                                  $backup->{'endTime'},
522                                  substr($backup->{'type'},0,4),                                  substr($backup->{'type'},0,4),
523                                  $shareID,                                  $shareID,
                                 $size,  
524                          );                          );
525    
526                          print " commit";                          my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
527                          $dbh->commit();  
528                            eval {
529                                    $sth->{update_backups_size}->execute(
530                                            $size,
531                                            $hostID,
532                                            $backupNum,
533                                            $backup->{'endTime'},
534                                            substr($backup->{'type'},0,4),
535                                            $shareID,
536                                    );
537                                    print " commit";
538                                    $dbh->commit();
539                            };
540                            if ($@) {
541                                    print " rollback";
542                                    $dbh->rollback();
543                            }
544    
545                          my $dur = (time() - $t) || 1;                          my $dur = (time() - $t) || 1;
546                          printf(" %d/%d files %d/%d dirs %0.2f MB [%.2f/s dur: %s]\n",                          printf(" %d/%d files %d/%d dirs %0.2f MB [%.2f/s dur: %s]\n",
# Line 604  sub getShareID() { Line 579  sub getShareID() {
579    
580          $sth->{insert_share} ||= $dbh->prepare(qq{          $sth->{insert_share} ||= $dbh->prepare(qq{
581                  INSERT INTO shares                  INSERT INTO shares
582                          (hostID,name,share,localpath)                          (hostID,name,share)
583                  VALUES (?,?,?,?)                  VALUES (?,?,?)
584          });          });
585    
586          my $drop_down = $hostname . '/' . $share;          my $drop_down = $hostname . '/' . $share;
587          $drop_down =~ s#//+#/#g;          $drop_down =~ s#//+#/#g;
588    
589          $sth->{insert_share}->execute($hostID,$share, $drop_down ,undef);          $sth->{insert_share}->execute($hostID,$share, $drop_down);
590          return $dbh->last_insert_id(undef,undef,'shares',undef);          return $dbh->last_insert_id(undef,undef,'shares',undef);
591  }  }
592    
# Line 628  sub found_in_db { Line 603  sub found_in_db {
603                  SELECT 1 FROM files                  SELECT 1 FROM files
604                  WHERE shareID = ? and                  WHERE shareID = ? and
605                          path = ? and                          path = ? and
606                          date = ? and                          size = ? and
607                          size = ?                          ( date = ? or date = ? or date = ? )
608                  LIMIT 1                  LIMIT 1
609          });          });
610    
611          my @param = ($shareID,$path,$date,$size);          my @param = ($shareID,$path,$size,$date, $date-$dst_offset, $date+$dst_offset);
612          $sth->{file_in_db}->execute(@param);          $sth->{file_in_db}->execute(@param);
613          my $rows = $sth->{file_in_db}->rows;          my $rows = $sth->{file_in_db}->rows;
614          print STDERR "## found_in_db($shareID,$path,$date,$size) ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);          print STDERR "## found_in_db($shareID,$path,$date,$size) ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);
# Line 683  sub recurseDir($$$$$$$$) { Line 658  sub recurseDir($$$$$$$$) {
658                                  $filesInBackup->{$path_key}->{'size'}                                  $filesInBackup->{$path_key}->{'size'}
659                          ));                          ));
660    
661                            my $key_dst_prev = join(" ", (
662                                    $shareID,
663                                    $dir,
664                                    $path_key,
665                                    $filesInBackup->{$path_key}->{'mtime'} - $dst_offset,
666                                    $filesInBackup->{$path_key}->{'size'}
667                            ));
668    
669                            my $key_dst_next = join(" ", (
670                                    $shareID,
671                                    $dir,
672                                    $path_key,
673                                    $filesInBackup->{$path_key}->{'mtime'} + $dst_offset,
674                                    $filesInBackup->{$path_key}->{'size'}
675                            ));
676    
677                          my $found;                          my $found;
678                          if (! defined($beenThere->{$key}) && ! ($found = found_in_db($key, @data)) ) {                          if (
679                                    ! defined($beenThere->{$key}) &&
680                                    ! defined($beenThere->{$key_dst_prev}) &&
681                                    ! defined($beenThere->{$key_dst_next}) &&
682                                    ! ($found = found_in_db($key, @data))
683                            ) {
684                                  print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2);                                  print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2);
685    
686                                  if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {                                  if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {

Legend:
Removed from v.131  
changed lines
  Added in v.305

  ViewVC Help
Powered by ViewVC 1.1.26