IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 24, 2015, 5:35:11 PM (11 years ago)
Author:
watersc1
Message:

Commiting the run versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/stsci_disks/p0_large.pl

    r38647 r38682  
    7676
    7777my $time = time();
    78 my $logDest = "neb://any/stsci_shuffle/large/${host}.${volume}/${dir}.log.${time}";
     78my $logDest = "neb://any/stsci_shuffle/sizes/${host}.${volume}/${dir}.log";
    7979my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n";
    8080$ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n";
     
    104104my $root = "/data/${host}.${volume}/nebulous/${dir}";
    105105my @subdirectories = <$root/*>;
     106my $size = 0;
     107my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k
     108my ($size_ota,$size_pv1,$size_pv2,$size_md) = (0,0,0,0);
    106109foreach my $subdir (@subdirectories) {
    107110    my @files = <${subdir}/*>;
     
    110113       
    111114        my @stat = stat($f);
    112         my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k
     115        $size += $stat[7];
    113116#       print "$f $stat[7]\n"; die;
    114         if ($stat[7] > $limit) {
    115             my $ins_id = $f;
    116             $ins_id =~ s/^$subdir\///;
    117             $ins_id =~ s/\..*//;
     117        if ($f =~ /ota/) { $size_ota += $stat[7]; }
     118        if ($f =~ /LAP.ThreePi.20120706/) { $size_pv1 += $stat[7]; }
     119        if ($f =~ /LAP.ThreePi.20130717/) { $size_pv2 += $stat[7]; }
     120        if ($f =~ /MD/) { $size_md += $stat[7]; }
    118121
    119             my $key = $f;
    120             $key =~  s/.*\/${ins_id}\.//;
    121             $key =~  s%:%/%g;
     122
     123#       if ($stat[7] > $limit) {
     124#           if (0) {
     125#               my $ins_id = $f;
     126#               $ins_id =~ s/^$subdir\///;
     127#               $ins_id =~ s/\..*//;
    122128               
    123             my $uris = $neb->find_instances($key);
    124             my $found = 0;
    125             foreach my $uri (@{ $uris }) {
    126                 if ($uri eq "file://${f}") {
    127                     $found = 1;
    128                 }
    129             }
    130             if ($#{ $uris } == -1) { # true orphan
    131                 if ($key =~ /ecliptic/) {
    132                     $key =~ s%/00hr%:00hr%;
    133                     $neb->replicate($key);
    134                     print "#replicate $key\n";
    135                 }
    136                 $found = -1;
    137             }
    138             print "$f $stat[7] $key $found\n";
    139             if ($found == 0) {
    140 #               print "rm $f\n";
    141                 unlink($f);
    142                 foreach my $rsync (@rsync_vols) {
    143                     my $test_f = $f;
    144                     $test_f =~ s%^/data/%%;
    145                     $test_f = "/data/${rsync}/stsci_shuffle/${test_f}";
    146                     if (-e $test_f) {
    147                         unlink($f);
    148 #                       print "rm $test_f\n";
    149                     }
    150                 }
    151             }
    152         }
     129#               my $key = $f;
     130#               $key =~  s/.*\/${ins_id}\.//;
     131#               $key =~  s%:%/%g;
     132               
     133#               my $uris = $neb->find_instances($key);
     134#               my $found = 0;
     135#               foreach my $uri (@{ $uris }) {
     136#                   if ($uri eq "file://${f}") {
     137#                       $found = 1;
     138#                   }
     139#               }
     140#               if ($#{ $uris } == -1) { # true orphan
     141#                   if ($key =~ /ecliptic/) {
     142#                       $key =~ s%/00hr%:00hr%;
     143#                       $neb->replicate($key);
     144#                       print "#replicate $key\n";
     145#                   }
     146#                   $found = -1;
     147#               }
     148#               print "$f $stat[7] $key $found\n";
     149#               if ($found == 0) {
     150# #             print "rm $f\n";
     151#                   unlink($f);
     152#                   foreach my $rsync (@rsync_vols) {
     153#                       my $test_f = $f;
     154#                       $test_f =~ s%^/data/%%;
     155#                       $test_f = "/data/${rsync}/stsci_shuffle/${test_f}";
     156#                       if (-e $test_f) {
     157#                           unlink($f);
     158# #                     print "rm $test_f\n";
     159#                       }
     160#                   }
     161#               }
     162#           }
     163#       }
    153164    }
    154 #    print STDERR "$subdir\n";
    155165}
     166my $Msize = $size / 1024 / 1024;
     167print "$root $size $Msize\n";
     168print "OTA $size_ota\n";
     169print "PV1 $size_pv1\n";
     170print "PV2 $size_pv2\n";
     171print "MD $size_md\n";
     172
Note: See TracChangeset for help on using the changeset viewer.