IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32548


Ignore:
Timestamp:
Oct 13, 2011, 3:58:10 PM (15 years ago)
Author:
watersc1
Message:

safer repair version that should deal with ippb02 being full.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110622/Nebulous/bin/neb-repair

    r32530 r32548  
    7373        open($fh,$files[$i]);
    7474        $md5sums[$i] = Digest::MD5->new->addfile($fh)->hexdigest;
     75        close($fh);
     76
    7577        $md5sum_uniq{$md5sums[$i]} = 1;
     78
     79        if ($md5sums[$i] eq 'd41d8cd98f00b204e9800998ecf8427e') {
     80            $existance[$i] = 0;
     81            next;
     82        }
     83
    7684        push @{ $md5sum_valid{$md5sums[$i]} }, $files[$i];
    7785        $last_f = $files[$i];
    78         close($fh);
    7986    }
    8087    else {
     
    119126                    system("cp $valid_file $f");
    120127                    if ($? >> 8 != 0) {
     128                        if ($existance[0] == 1) {
     129                            # We can fix this with culls and replications.
     130                            print("neb-replicate $key\n");
     131                            system("neb-replicate $key");
     132                            if ($? >> 8 == 0) {
     133                                my $bad_volume = (split /\//, $f)[2];
     134                                print("neb-cull --volume $bad_volume $key\n");
     135                                system("neb-cull --volume $bad_volume $key");
     136                            }
     137                        }
    121138                        die "Failed to copy file $valid_file to $f!\n";
    122139                    }
Note: See TracChangeset for help on using the changeset viewer.