/[BackupPC]/trunk/bin/BackupPC_incPartsUpdate
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_incPartsUpdate

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

revision 264 by dpavlin, Tue Dec 13 00:10:47 2005 UTC revision 268 by dpavlin, Tue Dec 13 18:08:44 2005 UTC
# Line 114  sub tar_check($$$$) { Line 114  sub tar_check($$$$) {
114    
115                  if (my $row = $sth_md5->fetchrow_hashref) {                  if (my $row = $sth_md5->fetchrow_hashref) {
116                          return if (                          return if (
117                                  $row->{tar_size} == $tar_size &&                                  $row->{tar_size} >= $tar_size &&
118                                  $row->{size} == $size &&                                  $row->{size} == $size &&
119                                  $row->{md5} eq $md5 &&                                  $row->{md5} eq $md5 &&
120                                  $row->{items} == $items                                  $row->{items} == $items
# Line 141  sub tar_check($$$$) { Line 141  sub tar_check($$$$) {
141          if ($debug) {          if ($debug) {
142                  print STDERR " {{ CHECK: ${host}:${share}#${num} and $filename";                  print STDERR " {{ CHECK: ${host}:${share}#${num} and $filename";
143          } else {          } else {
144                  print " check";                  print " check $filename";
145          }          }
146    
147          my @tar_parts;          my @tar_parts;
# Line 162  sub tar_check($$$$) { Line 162  sub tar_check($$$$) {
162    
163          my $backup_part;          my $backup_part;
164    
165          print " reading";          print " reading" if ($opt{d});
166    
167          foreach my $tarfilename (@tar_parts) {          foreach my $tarfilename (@tar_parts) {
168    
# Line 171  sub tar_check($$$$) { Line 171  sub tar_check($$$$) {
171                  my $path = "$tar_dir/$tarfilename";                  my $path = "$tar_dir/$tarfilename";
172                  my $md5_path = $path;                  my $md5_path = $path;
173                  $md5_path =~ s/\.tar\.gz$/.md5/ || die "can't create md5 filename from $md5_path";                  $md5_path =~ s/\.tar\.gz$/.md5/ || die "can't create md5 filename from $md5_path";
174                  if (! -e $md5_path) {                  if (! -e $md5_path || -z $md5_path) {
175                          print ", creating md5";                          print ", creating md5";
176                          system( $bin->{md5sum} . " $path > $md5_path") == 0 or die "can't create md5 $path: $!";                          system( $bin->{md5sum} . " $path > $md5_path") == 0 or die "can't create md5 $path: $!";
177                  }                  }
178    
179                  my $md5 = read_file( $md5_path ) || die "can't read md5sum file $md5_path: $!";                  my $md5 = read_file( $md5_path ) || die "can't read md5sum file $md5_path: $!";
180                    $md5 =~ s#\s.*$##;
181    
182                  my $part_nr = 1;                  my $part_nr = 1;
183                  $part_nr = $1 if ($tarfilename =~ m#/(\d+)\.tar\.gz#);                  $part_nr = $1 if ($tarfilename =~ m#/(\d+)\.tar\.gz#);
# Line 290  while (my $row = $sth->fetchrow_hashref) Line 291  while (my $row = $sth->fetchrow_hashref)
291    
292          print "# size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d});          print "# size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d});
293    
294          if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} == $size) {          if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} >= $size) {
295                  if ($check) {                  if ($check) {
296                          tar_check($row->{'host'}, $row->{'share'}, $row->{'num'}, $tar_file) && next;                          tar_check($row->{'host'}, $row->{'share'}, $row->{'num'}, $tar_file) && next;
297                  } else {                  } else {

Legend:
Removed from v.264  
changed lines
  Added in v.268

  ViewVC Help
Powered by ViewVC 1.1.26