Changeset 7460 for trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
- Timestamp:
- 01/10/06 22:12:58 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
r7329 r7460 20 20 # Author(s): Daniela Dorner 08/2004 <mailto:dorner@astro.uni-wuerzburg.de> 21 21 # 22 # Copyright: MAGIC Software Development, 2000-200 422 # Copyright: MAGIC Software Development, 2000-2006 23 23 # 24 24 # 25 25 # ======================================================================== 26 26 # 27 # This script launches the datacheck for all runs, which are not yet 28 # checked 29 # 30 # After checking, if the script is already running, the todolist is 31 # written by using the macro getdolist.C 32 # Then for each run the following steps are done: 33 # - filldotraw.C 34 # - sinope (once for data and once for calibration events) 35 # - fillsinope 36 # - reset ExclusionsDone, so that the result from the datacheck can be 37 # taken into account when doexclusions is running the next time 38 # If this was successful, the status is inserted into the database using 39 # the macro setstatus.C 27 40 # 28 41 … … 46 59 scriptlogpath=$logpath/run/dodatacheck/`date +%Y/%m` 47 60 makedir $scriptlogpath 48 49 61 scriptlog=$scriptlogpath/dodatacheck-$datetime.log 50 62 … … 53 65 makedir $getstatuslogpath >> $scriptlog 2>&1 54 66 67 # check if there are already todo files 55 68 echo "checking if other todo-files are there" >> $scriptlog 2>&1 56 69 if ls $todofile-[1-9]*.txt >> $scriptlog 2>&1 57 70 then 58 71 echo "other file(s) on disk " >> $scriptlog 2>&1 59 echo " -> choose one file and start calibrating" >> $scriptlog 2>&172 echo " -> choose one file and start datacheck " >> $scriptlog 2>&1 60 73 else 61 74 date > $lockpath/lock-getting-dodatacheck-list.txt >> $scriptlog 2>&1 … … 70 83 esac 71 84 72 if ls $todofile-[1-9]*.txt >> $scriptlog 2>&1 73 then 74 echo "other file(s) on disk " >> $scriptlog 2>&1 75 echo " -> choose one file and start datacheck" >> $scriptlog 2>&1 76 else 77 echo "getting list..." >> $scriptlog 2>&1 78 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 79 80 case $check0 in 81 1) echo "check0=$check0 -> everything ok -> do datacheck" >> $scriptlog 2>&1;; 82 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 83 esac 84 fi 85 echo "getting list..." >> $scriptlog 2>&1 86 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 87 88 case $check0 in 89 1) echo "check0=$check0 -> everything ok -> do datacheck" >> $scriptlog 2>&1;; 90 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 91 esac 85 92 rm -v $lockpath/lock-getting-dodatacheck-list.txt >> $scriptlog 2>&1 86 93 fi 87 94 88 95 96 # finding a todo file 89 97 nr=bla 90 98 echo "finding the right todo-file" >> $scriptlog 2>&1 … … 92 100 93 101 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1 94 95 102 for todofile in ${todofiles[@]} 96 103 do … … 120 127 121 128 129 # get run(s) from todo file 122 130 runs=(`cat $todofile`) 123 124 131 if [ "$runs" = "" ] 125 132 then … … 131 138 fi 132 139 140 # processing run(s) 133 141 echo "runs: "${runs[@]} >> $scriptlog 2>&1 134 135 142 for run in ${runs[@]} 136 143 do … … 143 150 date=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw | cut -c 22-31` 144 151 echo "date: "$date >> $scriptlog 2>&1 152 # for sinope the date is needed in the format YYYY-MM-DD 145 153 date2=`echo $date | sed -e 's/\//-/g'` 146 154 echo "date2: "$date2 >> $scriptlog 2>&1 147 155 156 # running filldotraw 148 157 filldotrawpath=$logpath/filldotraw/$date 149 158 makedir $filldotrawpath >> $scriptlog 2>&1 … … 160 169 esac 161 170 171 # running sinope 162 172 sinopepath=$datapath/sinope/$date 163 173 makedir $sinopepath >> $scriptlog 2>&1 … … 183 193 done 184 194 195 # running fillsinope 185 196 fillsinopepath=$logpath/fillsinope/$date 186 197 makedir $fillsinopepath >> $scriptlog 2>&1 … … 191 202 192 203 case $check3 in 193 1) echo "check3=$check3 -> everything ok -> set exclusions..." >> $scriptlog 2>&1204 1) echo "check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1 194 205 ;; 195 206 *) echo "check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 … … 197 208 esac 198 209 199 echo "resetting the status for fExclusions done for date $date2" >> $scriptlog 2>&1 210 # resetting the status for exclusions 211 echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1 200 212 resetlogpath=$logpath/resetexclusions/$date 201 213 echo "resetlogpath: $resetlogpath" >> $scriptlog 2>&1 … … 212 224 esac 213 225 226 # set status 214 227 echo "inserting the status for the datacheck for run $run into the db" >> $scriptlog 2>&1 215 228 setstatuslogpath=$logpath/setstatus/datacheck/$date
Note:
See TracChangeset
for help on using the changeset viewer.