tolerate bigger file sizes in database than on filesystem, consider zero-sized
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 13 Dec 2005 00:37:29 +0000 (00:37 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 13 Dec 2005 00:37:29 +0000 (00:37 +0000)
md5 file invalid (it is)

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@266 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_incPartsUpdate

index d7ef2ec..1ea28c0 100755 (executable)
@@ -171,7 +171,7 @@ sub tar_check($$$$) {
                my $path = "$tar_dir/$tarfilename";
                my $md5_path = $path;
                $md5_path =~ s/\.tar\.gz$/.md5/ || die "can't create md5 filename from $md5_path";
-               if (! -e $md5_path) {
+               if (! -e $md5_path || -z $md5_path) {
                        print ", creating md5";
                        system( $bin->{md5sum} . " $path > $md5_path") == 0 or die "can't create md5 $path: $!";
                }
@@ -291,7 +291,7 @@ while (my $row = $sth->fetchrow_hashref) {
 
        print "# size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d});
 
-       if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} == $size) {
+       if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} >= $size) {
                if ($check) {
                        tar_check($row->{'host'}, $row->{'share'}, $row->{'num'}, $tar_file) && next;
                } else {