/[BackupPC]/trunk/bin/BackupPC_tarIncCreate
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_tarIncCreate

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

revision 155 by dpavlin, Thu Sep 1 20:24:13 2005 UTC revision 156 by dpavlin, Mon Oct 10 13:04:49 2005 UTC
# Line 82  my %opts; Line 82  my %opts;
82  my $in_backup_increment;  my $in_backup_increment;
83    
84    
85  if ( !getopts("th:n:p:r:s:b:w:", \%opts) ) {  if ( !getopts("th:n:p:r:s:b:w:v", \%opts) ) {
86      print STDERR <<EOF;      print STDERR <<EOF;
87  usage: $0 [options]  usage: $0 [options]
88    Required options:    Required options:
# Line 98  usage: $0 [options] Line 98  usage: $0 [options]
98       -p pathAdd      new path prefix       -p pathAdd      new path prefix
99       -b BLOCKS       BLOCKS x 512 bytes per record (default 20; same as tar)       -b BLOCKS       BLOCKS x 512 bytes per record (default 20; same as tar)
100       -w writeBufSz   write buffer size (default 1048576 = 1MB)       -w writeBufSz   write buffer size (default 1048576 = 1MB)
101         -v              verbose output
102  EOF  EOF
103      exit(1);      exit(1);
104  }  }
# Line 391  sub seedCache($$$) { Line 392  sub seedCache($$$) {
392          my $dsn = $Conf{SearchDSN};          my $dsn = $Conf{SearchDSN};
393          my $db_user = $Conf{SearchUser} || '';          my $db_user = $Conf{SearchUser} || '';
394                    
395          print STDERR curr_time(), "getting files for $host:$share increment $dumpNo...";          print STDERR curr_time(), "getting files for $host:$share increment $dumpNo..." if ($opts{v});
396          my $sql = q{          my $sql = q{
397                  SELECT path                  SELECT path
398                  FROM files                  FROM files
# Line 404  sub seedCache($$$) { Line 405  sub seedCache($$$) {
405          my $sth = $dbh->prepare($sql);            my $sth = $dbh->prepare($sql);  
406          $sth->execute($host, $share, $dumpNo);          $sth->execute($host, $share, $dumpNo);
407          my $count = $sth->rows;          my $count = $sth->rows;
408          print STDERR " found $count items\n";          print STDERR " found $count items\n" if ($opts{v});
409          while (my $row = $sth->fetchrow_arrayref) {          while (my $row = $sth->fetchrow_arrayref) {
410  print STDERR "+ ", $row->[0],"\n";  #print STDERR "+ ", $row->[0],"\n";
411                  $in_backup_increment->{ $row->[0] }++;                  $in_backup_increment->{ $row->[0] }++;
412          }          }
413                    
# Line 430  sub TarWriteFile Line 431  sub TarWriteFile
431    
432  #print STDERR "? $tarPath\n";  #print STDERR "? $tarPath\n";
433      return unless ($in_backup_increment->{$tarPath});      return unless ($in_backup_increment->{$tarPath});
434  print STDERR "A $tarPath\n";  #print STDERR "A $tarPath\n";
435    
436      if ( defined($PathRemove)      if ( defined($PathRemove)
437              && substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) {              && substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) {

Legend:
Removed from v.155  
changed lines
  Added in v.156

  ViewVC Help
Powered by ViewVC 1.1.26