Changeset 12623 for trunk/DataCheck
- Timestamp:
- 11/23/11 05:42:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/CheckRawData.sh
r12609 r12623 30 30 # get last 3 nights 31 31 dates=( `date +%Y/%m/%d` `date +%Y/%m/%d --date="-1day"` `date +%Y/%m/%d --date="-2day"` `date +%Y/%m/%d --date="-3day"` ) 32 dates=( `date +%Y/%m/%d --date="- 2day"` )32 dates=( `date +%Y/%m/%d --date="-3day"` ) 33 33 34 34 # do rsync for rawfiles of these dates … … 129 129 query5="SELECT fRunNumber FROM RunInfo WHERE fRunNumber="$runnumber" AND fFileNumber="$filenumberfromfileorig 130 130 query5=$query5" AND NOT ISNULL(fMd5sumRaw) AND NOT ISNULL(fMd5sumRawZip)" 131 echo "Q5:"$query5 >> $logfile 2>&1 2>&1131 echo "Q5:"$query5 >> $logfile 2>&1 132 132 result5=`/usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -e "$query5"` 133 133 … … 143 143 if [ "$skipmd5sum" == "no" ] || [ "$result5" == "" ] 144 144 then 145 echo "calculation md5sum for raw..." >> $logfile 2>&1146 md5sum=`md5sum $file | cut -d' ' -f1`147 145 zipfile=`echo $file | sed -e 's/raw/zipraw/' -e 's/fits/fits.gz/'` 148 echo "calculation md5sum for zipraw..." >> $logfile 2>&1 149 md5sumzip=`md5sum $zipfile | cut -d' ' -f1` 146 # only do the md5sum if the zipfile is already available 147 if ls $zipfile >/dev/null >> $logfile 2>&1 148 then 149 echo "calculation md5sum for raw..." >> $logfile 2>&1 150 md5sum=`md5sum $file | cut -d' ' -f1` 151 echo "calculation md5sum for zipraw..." >> $logfile 2>&1 152 md5sumzip=`md5sum $zipfile | cut -d' ' -f1` 153 fi 150 154 fi 151 155 fi … … 159 163 roi=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep NROI | grep -v NROITM | grep -E -o '[0-9]{1,4}'` 160 164 numevents=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep Events | grep -E -o '[0-9]+'` 161 runstart=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep TSTART | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 162 runstop=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep TSTOP | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 165 # in newest data start time is in DATE-OBS 166 # in older data start time is in TSTART 167 # in the beginning TSTART was empty 168 runstart=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep DATE-OBS | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 169 runstart2=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep TSTART | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 163 170 if [ "$runstart" == "" ] 164 171 then 165 runstart=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep DATE | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 166 fi 172 if [ "$runstart2" == "" ] 173 then 174 runstart=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep DATE | grep -v 'DATE-' | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 175 else 176 runstart=$runstart2 177 fi 178 fi 179 # in newest data start time is in DATE-END 180 # in older data start time is in TSTOP 181 # in the beginning TSTOP was empty 182 runstop=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep DATE-END | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 183 runstop2=`/home/fact/FACT++/fitsdump -h -t Events $file 2>/dev/null | grep TSTOP | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{6}'` 167 184 if [ "$runstop" == "" ] 168 185 then 169 runstop=`stat $file 2>/dev/null | grep Modify | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9][ ][0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{9}'` 186 if [ "$runstop2" == "" ] 187 then 188 runstop=`stat $file 2>/dev/null | grep Modify | grep -E -o '20[1-9][0-9][\-][01][0-9][\-][0-3][0-9][ ][0-2][0-9]:[0-6][0-9]:[0-6][0-9][.][0-9]{9}'` 189 else 190 runstop=$runstop2 191 fi 170 192 fi 171 193 … … 207 229 query4=$query4" "$querystop 208 230 echo "Q4:"$query4 >> $logfile 2>&1 209 if ! /usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -e "$query4" 231 if ! /usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -e "$query4" >> $logfile 2>&1 210 232 then 211 233 echo "insert/update of "$numfromfile" to mysql" >> $logfile 2>&1
Note:
See TracChangeset
for help on using the changeset viewer.