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 |
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; |
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 |
|
|
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#); |
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 { |