Changeset 7927 for trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
- Timestamp:
- 08/24/06 12:15:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
r7920 r7927 51 51 date >> $scriptlog 2>&1 52 52 53 # get todo file 54 possibletodofiles=`ls -r $listpath/ToDo-*-$column-*.txt` >> $scriptlog 2>&1 55 if [ "$possibletodofiles" = "" ] 56 then 57 echo "ERROR: in $program no todofiles found => something went wrong in jobmanager" 58 finish >> $scriptlog 2>&1 59 else 60 singleprocess="yes" 61 echo "todofiles: "${possibletodofiles[@]} >> $scriptlog 2>&1 62 for possibletodofile in ${possibletodofiles[@]} 63 do 64 if ! ls $possibletodofile >> $scriptlog 2>&1 65 then 66 echo "file is not on disk -> continue" >> $scriptlog 2>&1 67 continue 68 fi 69 lockfile=`echo $possibletodofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 70 checklock >> $scriptlog 2>&1 71 todofile=$possibletodofile 72 done 73 fi 74 if [ "$todofile" = "" ] 75 then 76 echo "no todofile found -> exit" >> $scriptlog 2>&1 77 finish >> $scriptlog 2>&1 78 fi 53 # get run # 54 gettodo >> $scriptlog 2>&1 55 run=$process 79 56 80 # get run(s) from todo file 81 runs=(`cat $todofile`) 82 if [ "$runs" = "" ] 83 then 84 echo "nothing to do -> exit" >> $scriptlog 2>&1 85 finish >> $scriptlog 2>&1 86 fi 87 echo "runs: "${runs[@]} >> $scriptlog 2>&1 88 rm -v $todofile >> $scriptlog 2>&1 57 # lock sequ 58 lockfile=$lockpath/lock-$table-$column-$run.txt 59 checklock >> $scriptlog 2>&1 89 60 90 61 cd $mars 91 62 92 # processing run(s) 93 for run in ${runs[@]} 63 echo "do $program for run "$run >> $scriptlog 2>&1 64 no=`printf %08d $run | cut -c 0-2` 65 no2=`printf %08d $run` 66 var1=$date 67 var2=$no2 68 rawfile=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw -o -name *${run}_[D,P,C,S]_*_E.raw.gz` 69 echo "rawfile: "$rawfile >> $scriptlog 2>&1 70 date=`echo $rawfile | cut -c 22-31` 71 # for sinope the date is needed in the format YYYY-MM-DD 72 date2=`echo $date | sed -e 's/\//-/g'` 73 74 setstatus "start" >> $scriptlog 2>&1 75 76 # running filldotraw 77 echo "doing filldotraw..." >> $scriptlog 2>&1 78 filldotrawpath=$logpath/filldotraw/$date 79 makedir $filldotrawpath >> $scriptlog 2>&1 80 filldotrawlogfile=$filldotrawpath/filldotraw-$no2.log 81 82 check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'` 83 84 case $check1 in 85 1) echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1 86 ;; 87 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 88 check="no" 89 setstatus "stop" >> $scriptlog 2>&1 90 continue ;; 91 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 92 com=$Ffillraw 93 check=$check1 94 setstatus "stop" >> $scriptlog 2>&1 95 continue ;; 96 esac 97 98 # running sinope 99 sinopepath=$datapath/sinope/$date 100 makedir $sinopepath >> $scriptlog 2>&1 101 102 sins=( "-dat" "-cal") 103 for sin in ${sins[@]} 94 104 do 95 echo "do $program for run "$run >> $scriptlog 2>&1 96 no=`printf %08d $run | cut -c 0-2` 97 no2=`printf %08d $run` 98 var1=$date 99 var2=$no2 100 rawfile=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw -o -name *${run}_[D,P,C,S]_*_E.raw.gz` 101 echo "rawfile: "$rawfile >> $scriptlog 2>&1 102 date=`echo $rawfile | cut -c 22-31` 103 # for sinope the date is needed in the format YYYY-MM-DD 104 date2=`echo $date | sed -e 's/\//-/g'` 105 sinopefile=sinope$sin$no2 106 107 echo "running sinope $sin..." >> $scriptlog 2>&1 108 ./sinope -b -q -v4 -f $sin --outf=$sinopefile --out=$sinopepath --log=$sinopepath/$sinopefile.log --html=$sinopepath/$sinopefile.html --run=$run --date=$date2 2>> $scriptlog > /dev/null 109 check2=$? 110 111 case $check2 in 112 0) echo " check2=$check2 -> everything ok -> go on with $program..." >> $scriptlog 2>&1 113 ;; 114 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 115 com=$Fsinope 116 # comadd= 117 check=$check2 118 setstatus "stop" >> $scriptlog 2>&1 119 continue 2;; 120 esac 121 check2=1 122 done 105 123 106 setstatus "start" >> $scriptlog 2>&1 124 # running fillsinope 125 fillsinopepath=$logpath/fillsinope/$date 126 makedir $fillsinopepath >> $scriptlog 2>&1 127 fillsinopelogfile=$fillsinopepath/fillsinope-$no2.log 107 128 108 # running filldotraw 109 echo "doing filldotraw..." >> $scriptlog 2>&1 110 filldotrawpath=$logpath/filldotraw/$date 111 makedir $filldotrawpath >> $scriptlog 2>&1 112 filldotrawlogfile=$filldotrawpath/filldotraw-$no2.log 129 echo "doing fillsinope..." >> $scriptlog 2>&1 130 check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'` 113 131 114 check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'` 132 case $check3 in 133 1) echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1 134 ;; 135 0) echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1 136 check="no" 137 setstatus "stop" >> $scriptlog 2>&1 138 continue ;; 139 *) echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 140 com=$Ffillsinope 141 check=$check3 142 setstatus "stop" >> $scriptlog 2>&1 143 continue ;; 144 esac 115 145 116 case $check1 in 117 1) echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1 118 ;; 119 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 120 check="no" 121 setstatus "stop" >> $scriptlog 2>&1 122 continue ;; 123 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 124 com=$Ffillraw 125 check=$check1 126 setstatus "stop" >> $scriptlog 2>&1 127 continue ;; 128 esac 129 130 # running sinope 131 sinopepath=$datapath/sinope/$date 132 makedir $sinopepath >> $scriptlog 2>&1 133 134 sins=( "-dat" "-cal") 135 for sin in ${sins[@]} 136 do 137 sinopefile=sinope$sin$no2 138 139 echo "running sinope $sin..." >> $scriptlog 2>&1 140 ./sinope -b -q -v4 -f $sin --outf=$sinopefile --out=$sinopepath --log=$sinopepath/$sinopefile.log --html=$sinopepath/$sinopefile.html --run=$run --date=$date2 2>> $scriptlog > /dev/null 141 check2=$? 142 143 case $check2 in 144 0) echo " check2=$check2 -> everything ok -> go on with $program..." >> $scriptlog 2>&1 145 ;; 146 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 147 com=$Fsinope 148 # comadd= 149 check=$check2 150 setstatus "stop" >> $scriptlog 2>&1 151 continue 2;; 152 esac 153 check2=1 154 done 155 156 # running fillsinope 157 fillsinopepath=$logpath/fillsinope/$date 158 makedir $fillsinopepath >> $scriptlog 2>&1 159 fillsinopelogfile=$fillsinopepath/fillsinope-$no2.log 146 # resetting the status for exclusions 147 echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1 148 resetlogpath=$logpath/resetexclusions/$date 149 makedir $resetlogpath >> $scriptlog 2>&1 150 resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log 160 151 161 echo "doing fillsinope..." >> $scriptlog 2>&1 162 check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'` 152 check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'` 153 case $check5 in 154 1) echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1 155 ;; 156 0) echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1 157 check="no" 158 setstatus "stop" >> $scriptlog 2>&1 159 continue ;; 160 *) echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1 161 com=$Fresetexcl 162 comadd=`echo $date2 | sed -e 's/-//g'` 163 check=$check5 164 setstatus "stop" >> $scriptlog 2>&1 165 continue ;; 166 esac 163 167 164 case $check3 in 165 1) echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1 166 ;; 167 0) echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1 168 check="no" 169 setstatus "stop" >> $scriptlog 2>&1 170 continue ;; 171 *) echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 172 com=$Ffillsinope 173 check=$check3 174 setstatus "stop" >> $scriptlog 2>&1 175 continue ;; 176 esac 177 178 # resetting the status for exclusions 179 echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1 180 resetlogpath=$logpath/resetexclusions/$date 181 makedir $resetlogpath >> $scriptlog 2>&1 182 resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log 183 184 check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'` 185 case $check5 in 186 1) echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1 187 ;; 188 0) echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1 189 check="no" 190 setstatus "stop" >> $scriptlog 2>&1 191 continue ;; 192 *) echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1 193 com=$Fresetexcl 194 comadd=`echo $date2 | sed -e 's/-//g'` 195 check=$check5 196 setstatus "stop" >> $scriptlog 2>&1 197 continue ;; 198 esac 199 200 # set status 201 statustime="Now()" 202 failed="NULL" 203 starttime="NULL" 204 failedtime="NULL" 205 var1=$date 206 var2=$no2 207 setstatus "stop" >> $scriptlog 2>&1 168 # set status 169 statustime="Now()" 170 failed="NULL" 171 starttime="NULL" 172 failedtime="NULL" 173 var1=$date 174 var2=$no2 175 setstatus "stop" >> $scriptlog 2>&1 208 176 done 209 177
Note:
See TracChangeset
for help on using the changeset viewer.