Changeset 38682 for trunk/tools/stsci_disks/p0_large.pl
- Timestamp:
- Aug 24, 2015, 5:35:11 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tools/stsci_disks/p0_large.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/stsci_disks/p0_large.pl
r38647 r38682 76 76 77 77 my $time = time(); 78 my $logDest = "neb://any/stsci_shuffle/ large/${host}.${volume}/${dir}.log.${time}";78 my $logDest = "neb://any/stsci_shuffle/sizes/${host}.${volume}/${dir}.log"; 79 79 my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n"; 80 80 $ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n"; … … 104 104 my $root = "/data/${host}.${volume}/nebulous/${dir}"; 105 105 my @subdirectories = <$root/*>; 106 my $size = 0; 107 my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k 108 my ($size_ota,$size_pv1,$size_pv2,$size_md) = (0,0,0,0); 106 109 foreach my $subdir (@subdirectories) { 107 110 my @files = <${subdir}/*>; … … 110 113 111 114 my @stat = stat($f); 112 my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k115 $size += $stat[7]; 113 116 # 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]; } 118 121 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/\..*//; 122 128 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 # } 153 164 } 154 # print STDERR "$subdir\n";155 165 } 166 my $Msize = $size / 1024 / 1024; 167 print "$root $size $Msize\n"; 168 print "OTA $size_ota\n"; 169 print "PV1 $size_pv1\n"; 170 print "PV2 $size_pv2\n"; 171 print "MD $size_md\n"; 172
Note:
See TracChangeset
for help on using the changeset viewer.
