Changeset 15381 for trunk/DataCheck/QuickLook
- Timestamp:
- 04/19/13 20:50:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step1.sh
r15305 r15381 4 4 printprocesslog "INFO starting $0" 5 5 6 #root=/opt/root_svn/bin/thisroot.sh7 #source $root8 #factpath=/home/fact/FACT++.in-run-fad-loss9 10 #anapath=/loc_data/analysis11 12 #rerun="yes"13 #rerun="no"14 # not needed anymore as the variable is set automatically15 # depending on whether the rawfile existed locally,16 # i.e. depending on whether the rsync in needed17 # still needed in case all rawfiles have been rsynced already18 19 6 # get date (before 18h there is no new data to be processed) 20 7 datepath=`date --date="-18HOUR" +%Y/%m/%d` 21 #datepath="2013/03/24" 8 date=`date --date="-18HOUR" +%Y%m%d` 9 #datepath="2013/04/17" 10 #date="20130417" 22 11 printprocesslog "INFO processing "$datepath 23 12 night=`echo $datepath | sed -e 's/\///g'` … … 71 60 72 61 printprocesslog "INFO get lists of raw files on newdaq and daq" 73 #files=( `ssh newdaq "find $rawpath -type f 2>/dev/null | sort"` )74 #files=( `ssh 172.16.100.100 "find $rawpath -type f 2>/dev/null | sort"` )75 62 files=( `find $rawpathnewdaq -type f 2>/dev/null | sort` ) 76 63 if [ ${#files[@]} -eq 0 ] … … 80 67 fi 81 68 fileslocal=( `find $rawpath -type f | sort` ) 69 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` ) 70 numdataruns=0 82 71 83 72 # create raw directory on daq, if not yet there 84 73 makedir $rawpath 85 74 86 87 while [ ${#fileslocal[@]} -lt ${#files[@]} ] || [ "$rerun" = "yes" ] 75 echo ${#fileslocal[@]}" "${#files[@]}" "${#callistofiles[@]} 76 77 while [ ${#fileslocal[@]} -ne ${#files[@]} ] || [ $numdataruns -ne ${#callistofiles[@]} ] 88 78 do 89 ##if ssh newdaq "ls $drivefile" 90 #if ls $drivefilenewdaq 91 #then 92 # printprocesslog "INFO rsync "$drivefilenewdaq 93 # #if ! rsync -av --progress newdaq:$drivefile $drivefile 94 # #if ! rsync -av --progress 172.16.100.100:$drivefile $drivefile 95 # if ! rsync -av --stats $drivefilenewdaq $drivefile 96 # then 97 # printprocesslog "WARN rsync of "$drivefilenewdaq" failed." 98 # fi 99 #fi 79 numdataruns=0 100 80 rsync_aux_file $drivefilenewdaq $drivefile 101 81 … … 110 90 then 111 91 nondrsfile=`echo $file | sed -e 's/[.]drs//g'` 112 #tstop=`ssh newdaq "source $root ; $factpath/fitsdump -h $nondrsfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'"`113 #tstop=`ssh 172.16.100.100 "source $root ; $factpath/fitsdump -h $nondrsfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'"`114 92 tstop=`$factpath/fitsdump -h $nondrsfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 115 93 else 116 #tstop=`ssh newdaq "source $root ; $factpath/fitsdump -h $file 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'"`117 #tstop=`ssh 172.16.100.100 "source $root ; $factpath/fitsdump -h $file 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'"`118 94 tstop=`$factpath/fitsdump -h $file 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 119 95 fi … … 121 97 then 122 98 printprocesslog "WARN "$file" not yet closed." 123 #fileaccessed=`ssh newdaq "find $file -amin -30"`124 #fileaccessed=`ssh 172.16.100.100 "find $file -amin -30"`125 99 fileaccessed=`find $file -amin -30` 126 #echo "fileaccessed: "$fileaccessed127 100 if ! [ "$fileaccessed" == "" ] 128 101 then … … 135 108 fi 136 109 110 source `dirname $0`/../Sourcefile.sh 137 111 if ! ls $localfile >/dev/null 2>&1 138 112 then 139 #if ! rsync -av --progress newdaq:$file $file 140 #if ! rsync -av --progress 172.16.100.100:$file $file 141 if ! rsync -av --stats $file $localfile 113 if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile 142 114 then 143 115 printprocesslog "ERROR something went wrong with rsync of "$file … … 146 118 fi 147 119 printprocesslog "INFO "$file" rsynced successfully." 148 rerun="no"149 else150 rerun="yes"151 120 fi 152 121 … … 157 126 runnum=`echo $localfile | cut -d_ -f3 | cut -d. -f1` 158 127 roi=`$factpath/fitsdump -h $localfile 2>/dev/null | grep ROI | grep -v ROITM | grep -E -o "[0-9][0-9][0-9][0-9]?" | sed -e "s/'//g" -e "s/_/-/g" -e "s/[.]//g"` 159 printprocesslog "DEBUG runnum "$runnum" runtype "$runtype" roi "$roi 128 numevts=`$factpath/fitsdump -h $file 2>/dev/null | grep Events | grep -E -o '[0-9]+'` 129 printprocesslog "DEBUG runnum "$runnum" runtype "$runtype" roi "$roi" numevts "$numevts 160 130 if [ "$runtype" == "drs-time-upshifted" ] 161 131 then 132 printprocesslog "INFO file "$file" has runtype drs-time-upshifted -> continue " 162 133 continue 163 134 fi 164 135 if [ "$runtype" == "data" ] 165 136 then 137 numdataruns=`echo " $numdataruns + 1 " | bc -l` 166 138 if [ "$fileerror" = "yes" ] 167 139 then … … 210 182 then 211 183 printprocesslog "WARN sourcekey empty - coordinates"${coordinates[@]} 184 fi 185 callistocount=`ps aux | grep RunCallisto | grep -E -o '20[12][0-9][01][0-9][0-3][0-9]_[0-9][0-9][0-9]' | sort | uniq | wc -l` 186 187 echo "cal: "$callistocount" numdat: "$numdataruns" numcallog: "${#callistofiles[@]} 188 # do not overload system in case of a lot of files to be processed 189 # callistocount is set in setup.fact.lp.data 190 if [ $callistocount -ge $numcallistos ] 191 then 192 printprocesslog "INFO "$callistocount" RunCallisto.sh are running -> continue" 193 echo "INFO "$callistocount" RunCallisto.sh are running -> continue" 194 continue 212 195 fi 213 196 callistolog=`dirname $seqfile | sed -e "s/sequences/${sourcekey}\/callisto/"`"/"$night"_"$runnum"-calibration.log" … … 222 205 echo "INFO starting RunCallisto.sh for "$sourcekey" "$seqfile 223 206 `dirname $0`/RunCallisto.sh $sourcekey $seqfile & 224 # do not overload system in case of a lot of files to be processed 225 if [ "$rerun" = "yes" ] 226 then 227 sleep 600 228 printprocesslog "INFO rerun=yes -> sleep 600..." 229 fi 230 fi 231 continue 207 fi 208 continue 209 else 210 # skip a non-data run when it has not 1000 evts 211 # as this means probably an fad-loss 212 if [ $numevts -ne 1000 ] 213 then 214 printprocesslog "INFO file "$file" is a non-data file ("$runtype") and has not 1000 events ("$nmevts")" 215 continue 216 fi 232 217 fi 233 218 printprocesslog "DEBUG runrow "$runrow" (from variable) " … … 271 256 fi 272 257 done 258 printprocesslog "INFO status after loop: "$callistocount" callistos running, "$numdataruns" data runs to process in total, "${#callistofiles[@]}" have already a callisto-logfile " 273 259 274 260 # get new file lists 275 261 printprocesslog "INFO get new file lists for "$datepath 276 #files=( `ssh newdaq "find $rawpath -type f | sort"` )277 #files=( `ssh 172.16.100.100 "find $rawpath -type f | sort"` )278 262 files=( `find $rawpathnewdaq -type f | sort` ) 279 263 fileslocal=( `find $rawpath -type f | sort` ) 264 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` ) 280 265 281 #update=282 #if [ ${#fileslocal[@]} -eq ${#files[@]} ]283 #then284 #sleep 60285 #echo "sleep 60..."286 # #files=( `ssh newdaq "find $rawpath -type f | sort"` )287 # files=( `ssh 172.16.100.100 "find $rawpath -type f | sort"` )288 # fileslocal=( `find $rawpath -type f| sort` )289 #fi266 update= 267 if [ ${#fileslocal[@]} -eq ${#files[@]} ] 268 then 269 sleep 60 270 echo "sleep 60..." 271 files=( `find $rawpathnewdaq -type f | sort` ) 272 fileslocal=( `find $rawpath -type f | sort` ) 273 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` ) 274 fi 290 275 done 291 276
Note:
See TracChangeset
for help on using the changeset viewer.