Changeset 42415
- Timestamp:
- Mar 16, 2023, 12:48:31 PM (3 years ago)
- Location:
- trunk/tools/eam/rawfix.20230221/src
- Files:
-
- 6 added
- 5 edited
-
check.rawfix.sh (modified) (1 diff)
-
check_chip_locations.pl (modified) (2 diffs)
-
check_md5s_dateobs.pl (modified) (2 diffs)
-
check_night_status.pl (added)
-
fix_chip_locations.pl (modified) (5 diffs)
-
fix_chip_locations_stage2.pl (added)
-
get_md5s_instances_stage2.pl (added)
-
rawfix.fixchip_s2.pt (added)
-
rawfix.md5chk_s2.pt (added)
-
rawfix.md5sum_s2.pt (added)
-
rawfix.pt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh
r42411 r42415 67 67 if ($mystate == "fixchip.done") goto good_state 68 68 if ($mystate == "fixchip.fail") goto good_state 69 if ($mystate == "rsync_s1.new") goto good_state70 if ($mystate == "rsync_s1.done") goto good_state71 if ($mystate == "rsync_s1.fail") goto good_state72 69 if ($mystate == "md5sum.new") goto good_state 73 70 if ($mystate == "md5sum.done") goto good_state 74 71 if ($mystate == "md5sum.fail") goto good_state 75 if ($mystate == "rsync_s2.new") goto good_state76 if ($mystate == "rsync_s2.done") goto good_state77 if ($mystate == "rsync_s2.fail") goto good_state78 72 if ($mystate == "md5chk.new") goto good_state 79 73 if ($mystate == "md5chk.done") goto good_state 80 74 if ($mystate == "md5chk.fail") goto good_state 75 76 # stage 2: 77 if ($mystate == "fixchip_s2.new") goto good_state 78 if ($mystate == "fixchip_s2.done") goto good_state 79 if ($mystate == "fixchip_s2.fail") goto good_state 80 if ($mystate == "md5sum_s2.new") goto good_state 81 if ($mystate == "md5sum_s2.done") goto good_state 82 if ($mystate == "md5sum_s2.fail") goto good_state 83 if ($mystate == "md5chk_s2.new") goto good_state 84 if ($mystate == "md5chk_s2.done") goto good_state 85 if ($mystate == "md5chk_s2.fail") goto good_state 86 87 # disable the rsyncs stages: run in directory from b-node 88 # if ($mystate == "rsync_s1.new") goto good_state 89 # if ($mystate == "rsync_s1.done") goto good_state 90 # if ($mystate == "rsync_s1.fail") goto good_state 91 # if ($mystate == "rsync_s2.new") goto good_state 92 # if ($mystate == "rsync_s2.done") goto good_state 93 # if ($mystate == "rsync_s2.fail") goto good_state 81 94 82 95 echo "ERROR: unknown mode $mystate" -
trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
r42406 r42415 67 67 my ($Nmain, $Nback, $Ndead) = &check_instance_xattr ($inforows, $ext_id, $data_st, $md5_sum); 68 68 69 &check_instance_state ($outfh, $ext_id, $ Nmain, $Nback, $Ndead);69 &check_instance_state ($outfh, $ext_id, $data_st, $md5_sum, $Nmain, $Nback, $Ndead); 70 70 } 71 71 … … 249 249 my $outfh = $_[0]; 250 250 my $extID = $_[1]; 251 my $Nmain = $_[2]; 252 my $Nback = $_[3]; 253 my $Ndead = $_[4]; 254 255 # SKIP : already fixed 251 my $data_st = $_[2]; 252 my $md5_sum = $_[3]; 253 my $Nmain = $_[4]; 254 my $Nback = $_[5]; 255 my $Ndead = $_[6]; 256 257 my $outinfo = "$extID $data_st $md5_sum"; 258 259 # GOOD : already fixed 256 260 if (($Nmain == 1) && ($Nback == 1)) { 257 print $outfh "GOOD: $ extID\n";258 return; 259 } 260 261 # single copy @ ITC, no backup261 print $outfh "GOOD: $outinfo\n"; 262 return; 263 } 264 265 # SING : single copy @ ITC, no backup 262 266 # make a backup 263 267 if (($Nmain == 1) && ($Nback == 0)) { 264 print $outfh "SING: $ extID\n";265 return; 266 } 267 268 # ITC files with a single backup copies need to be culled269 # cull Nmain - 1270 if (($Nmain > 1) && ($Nback == 1)) {271 print $outfh " CULL: $extID\n";272 return; 273 } 274 275 # multiple copies @ ITC268 print $outfh "SING: $outinfo\n"; 269 return; 270 } 271 272 # SBCK : single copy @ ATRC, no main copy 273 # make a backup @ ITC 274 if (($Nmain == 0) && ($Nback == 1)) { 275 print $outfh "SBCK: $outinfo\n"; 276 return; 277 } 278 279 # DUPS : multiple copies @ ITC, none at ATRC 276 280 # make a backup and cull Nmain - 1 277 281 if (($Nmain > 1) && ($Nback == 0)) { 278 print $outfh "DUPS: $extID\n"; 279 return; 280 } 281 282 # no more valid instances 283 if (($Nmain == 0) && ($Nback == 0) && $Ndead) { 284 print $outfh "DEAD: $extID\n"; 285 return; 286 } 287 if (($Nmain == 0) && ($Nback == 0) && ($Ndead == 0)) { 288 print $outfh "GONE: $extID\n"; 289 return; 290 } 291 292 # single copy @ ATRC 293 # make a backup @ ITC 294 if (($Nmain == 0) && ($Nback == 1)) { 295 print $outfh "SBCK: $extID\n"; 296 return; 297 } 298 299 # multiple copies @ ATRC, but none at ITC 282 print $outfh "DUPS: $outinfo\n"; 283 return; 284 } 285 286 # XBCK : multiple copies @ ATRC, but none at ITC 300 287 # make a backup at ITC, cull ATRC extras 301 288 if (($Nmain == 0) && ($Nback > 1)) { 302 print $outfh "XBCK: $extID\n"; 289 print $outfh "XBCK: $outinfo\n"; 290 return; 291 } 292 293 # DEAD : no more valid instances 294 if (($Nmain == 0) && ($Nback == 0) && $Ndead) { 295 print $outfh "DEAD: $outinfo\n"; 296 return; 297 } 298 # GONE : no more valid instances 299 if (($Nmain == 0) && ($Nback == 0) && ($Ndead == 0)) { 300 print $outfh "GONE: $outinfo\n"; 301 return; 302 } 303 304 # CUL1 : multiple ITC files, single backup 305 # cull only ITC 306 if (($Nmain > 1) && ($Nback == 1)) { 307 print $outfh "CUL1: $outinfo\n"; 308 return; 309 } 310 311 # CUL2 : multiple ATRC files, single ITC 312 # cull only ATRC 313 if (($Nback > 1) && ($Nmain == 1)) { 314 print $outfh "CUL2: $outinfo\n"; 315 return; 316 } 317 318 # CUL3 : excess ATRC & ITC files, cull from both? 319 # cull Nmain - 1 320 if (($Nback > 1) && ($Nmain > 1)) { 321 print $outfh "CUL3: $outinfo\n"; 303 322 return; 304 323 } 305 324 306 325 # unexpected state: 307 print $outfh "OOPS: $ extID\n";326 print $outfh "OOPS: $outinfo\n"; 308 327 return; 309 328 } -
trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl
r42411 r42415 1 1 #! /usr/bin/env perl 2 2 3 my $DEBUG = 4;3 my $DEBUG = 1; 4 4 my $time = time(); 5 5 … … 82 82 print STDOUT "FAIL: $inst $state $md5tru $md5obs\n"; 83 83 $Nfail ++; 84 } else { 85 if ($DEBUG > 2) { 86 print STDOUT "$inst $state $md5tru = $md5obs\n"; 87 } 84 88 } 85 89 } -
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42406 r42415 36 36 my $Nxbck = 0; 37 37 38 my $Ncul1 = 0; 39 my $Ncul2 = 0; 40 my $Ncul3 = 0; 41 38 42 foreach my $chip_id (@chip_ids) { 39 43 … … 49 53 50 54 # we expect lines of the form: STATE PATH 51 # e.g., GOOD: gpc1/20100502/o5318g0002d/o5318g0002d.ota76.fits 52 if (@words != 2) { die "error in URI list $urifile, line: $line\n"; }55 # e.g., GOOD: gpc1/20100502/o5318g0002d/o5318g0002d.ota76.fits DataState MD5sum 56 if (@words != 4) { die "error in URI list $urifile, line: $line\n"; } 53 57 54 58 my $state = $words[0]; 55 59 my $ext_id = $words[1]; 60 my $datast = $words[2]; 61 my $md5sum = $words[3]; 56 62 57 63 if ($state eq "GOOD:") { $Ngood++; next; } 58 64 if ($state eq "DEAD:") { $Ndead++; next; } 59 65 if ($state eq "GONE:") { $Ngone++; next; } 60 if ($state eq "DUPS:") { $Ndups++; next; }61 if ($state eq "XBCK:") { $Nxbck++; next; }62 66 63 67 # one copy at ITC: neb-replicate will create a copy at ATRC … … 68 72 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 69 73 open (OUTFILE, ">>$dateword/$newhost.inst.txt"); 70 print OUTFILE "$newfile \n";74 print OUTFILE "$newfile $datast $md5sum\n"; 71 75 close (OUTFILE); 72 76 $Nsing ++; … … 82 86 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 83 87 open (OUTFILE, ">>$dateword/$newhost.inst.txt"); 84 print OUTFILE "$newfile \n";88 print OUTFILE "$newfile $datast $md5sum\n"; 85 89 close (OUTFILE); 86 90 $Nsbck ++; 87 91 next; 88 92 } 93 94 # these are done in stage 2: 95 if ($state eq "DUPS:") { $Ndups++; next; } 96 if ($state eq "XBCK:") { $Nxbck++; next; } 97 98 # these are done in stage 3: 99 if ($state eq "CUL1:") { $Ncul1++; next; } 100 if ($state eq "CUL2:") { $Ncul2++; next; } 101 if ($state eq "CUL3:") { $Ncul3++; next; } 89 102 } 90 103 $volnum ++; … … 98 111 print "Nsbck: $Nsbck\n"; 99 112 print "Nxbck: $Nxbck\n"; 113 print "Ncul1: $Ncul1\n"; 114 print "Ncul2: $Ncul2\n"; 115 print "Ncul3: $Ncul3\n"; 100 116 101 117 exit 0; -
trunk/tools/eam/rawfix.20230221/src/rawfix.pt
r42411 r42415 9 9 10 10 # use this to find the files in this local directory 11 $mypath = /home/panstarrs/eugene/rawfix.20230221 11 # $mypath = /home/panstarrs/eugene/rawfix.20230221 12 13 # NOTE: use a directory located on a b-node so the results can 14 # be seen by both ATRC and ITC machines 15 $mypath = /data/ippb07.0/home/eugene/rawfix.20230221 12 16 13 17 if (not($?LOGDIR)) … … 19 23 # order is this file is not determinative, only the 20 24 # change of state from STAGE1.new -> STAGE1.done -> STAGE2.new 21 input rawfix.ckchip.pt 22 input rawfix.fixchip.pt 23 input rawfix.rsync_s1.pt 24 input rawfix.md5sum.pt 25 input rawfix.rsync_s2.pt 26 input rawfix.md5chk.pt 25 # input rawfix.ckchip.pt 26 # input rawfix.fixchip.pt 27 # input rawfix.md5sum.pt 28 # input rawfix.md5chk.pt 29 # input rawfix.fixchip_s2.pt 30 input rawfix.md5sum_s2.pt 31 #input rawfix.md5chk_s2.pt 32 33 # no need to run rsync if we use the b-node working directory: 34 # input rawfix.rsync_s1.pt 35 # input rawfix.rsync_s2.pt 27 36 28 37 ######################### UTILITIES #################################
Note:
See TracChangeset
for help on using the changeset viewer.
