- Timestamp:
- 07/30/08 18:25:59 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
r8482 r9056 50 50 callistorcseq=callisto.rc 51 51 callistorcnew=callisto_Dec04Jan05.rc 52 # reason why calibration with standard callisto.rc fails53 #reason1="Pulse is too much to the right, cannot go beyond logain limits!"54 #.* == hi or lo55 reason1="Pulse is too much to the right, out of .*-gain range"56 #reason2="No entry for resource id '2[45]' found in"57 echo "reason1: "$reason1 >> $scriptlog 2>&158 #echo "reason2: "$reason2 >> $scriptlog 2>&159 52 60 # find files containing reason 61 files=`find $datapath/callisto/ -name callisto*.log` 62 if [ "$files" = "" ] 53 # query failed callistos (returncode 13) from DB 54 query="SELECT fSequenceFirst, fTelescopeNumber from SequenceProcessStatus where fReturnCode=13 and fProgramId=14" 55 primaries=( `sendquery` ) 56 echo ${primaries[@]} 57 if [ ${#primaries[@]} -eq 0 ] 63 58 then 64 59 echo "nothing to do -> exit" >> $scriptlog 2>&1 65 60 finish >> $scriptlog 2>&1 66 61 fi 62 num=`expr ${#primaries[@]} / 2 ` 67 63 68 64 cd $mars 69 65 70 # make links for callisto.rc for which the callisto.log contains reason71 66 printprocesslog "INFO linking callisto.rc files" 72 for file in $files 73 do 74 # pulse=`cat $file | grep "$reason1\|$reason2"` 75 pulse=`cat $file | grep "$reason1"` 76 sequ=`echo $file | cut -d/ -f6` 77 path=`dirname $file` 78 callistorc=$path/$callistorcseq 67 for (( s=0 ; s < $num ; s++ )) 68 do 69 sequence=${primaries[$s+$s]} 70 telnum=${primaries[$s+$s+1]} 71 callistorc=$datapath/callisto/`printf %08d $sequence | cut -c 0-4`/`printf %08d $sequence`/$callistorcseq 72 if ! ls -l $callistorc 2>/dev/null | grep $callistorcnew >> $scriptlog 2>&1 73 then 74 printprocesslog "INFO linking $callistorcnew to $callistorc for sequ $sequence" 75 # resetting the calibration 76 echo "resetting the callisto for sequence $sequence" >> $scriptlog 2>&1 79 77 80 if [ ! "$pulse" = "" ] 81 then 82 if ! ls -l $callistorc | grep $callistorcnew >> $scriptlog 2>&1 78 query="UPDATE SequenceProcessStatus set fStartTime=NULL, fFailedTime=NULL, fProgramId=NULL, fReturnCode=NULL where fSequenceFirst=$sequence and fTelescopeNumber=$telnum" 79 if ! sendquery >> $scriptlog 2>&1 83 80 then 84 printprocesslog "INFO linking $callistorcnew to $callistorc for sequ $sequ" 85 # resetting the calibration 86 echo "resetting the callisto for sequence $sequ" >> $scriptlog 2>&1 87 echo " reason: $pulse" >> $scriptlog 2>&1 88 resetlogpath=$logpath/resetcallisto 89 makedir $resetlogpath >> $scriptlog 2>&1 90 resetlog=$resetlogpath/reset-callisto-$sequ.log 91 92 check1=`root -q -b $macrospath/resetcolumn.C+\("\"$column\""\,"\"$table\""\,"\"$sequ\""\,"\"$sequ\""\,kFALSE\) | tee $resetlog | intgrep` 93 case $check1 in 94 1) echo " check1=$check1 -> everything ok, callisto has been reset " >> $scriptlog 2>&1 95 printprocesslog "INFO resetted calibration successfully for sequence $sequ" 96 ;; 97 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 98 printprocesslog "WARN connection to DB failed" 99 check="no" 100 ;; 101 *) echo " check1=$check1 -> ERROR -> step could not be resetted -> continue " >> $scriptlog 2>&1 102 printprocesslog "ERROR resetcolumn.C failed for fCallisto for sequ $sequ" 103 continue 104 ;; 105 esac 106 #linking callisto.rc 107 ln -vfs $setuppath/callisto/$callistorcnew $callistorc >> $scriptlog 2>&1 81 printprocesslog "ERROR resetting calibration failed for sequence $sequence" 82 continue 83 else 84 printprocesslog "INFO resetted calibration successfully for sequence $sequence" 108 85 fi 86 87 #linking callisto.rc 88 if ln -vfs $setuppath/callisto/$callistorcnew $callistorc >> $scriptlog 2>&1 89 then 90 printprocesslog "INFO link callisto.rc successfully for sequence $sequence" 91 else 92 printprocesslog "ERROR linking callisto.rc failed for sequence $sequence" 93 fi 94 109 95 fi 110 96 done
Note:
See TracChangeset
for help on using the changeset viewer.