Changeset 18855 for trunk/DataCheck/QuickLook
- Timestamp:
- 05/14/17 21:00:03 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step1.sh
r18770 r18855 3 3 4 4 # remarks: 5 # rsync-server still used6 5 # move fileerror check to main-loop? 7 6 … … 20 19 datepath=$certaindate 21 20 else 22 datepath=`date --date="-19HOUR" +%Y/%m/%d` 21 # this has to be coordinated with the time when 22 # ClearNewdata.sh is running 23 datepath=`date --date="-18HOUR" +%Y/%m/%d` 23 24 fi 24 25 date=`echo $datepath | sed -e 's/\///g'` 25 26 printprocesslog "INFO processing "$datepath 26 27 27 auxpathnewdaq=/newdaq/aux/$datepath28 #auxpathnewdaq=/loc_data/aux/$datepath #to run on newdaq29 # create aux directory on daq, if not yet there30 28 auxpath=/loc_data/aux/$datepath 31 29 makedir $auxpath >/dev/null … … 38 36 makedir $calpath >/dev/null 39 37 rawpathnewdaq=/newdaq/raw/$datepath 40 #rawpathnewdaq=/loc_data/raw/$datepath #to run on newdaq41 38 rawpath=/loc_data/raw/$datepath 42 39 … … 44 41 # drive file with information about current source position 45 42 drivefile=$auxpath/${date}.DRIVE_CONTROL_SOURCE_POSITION.fits 46 drivefilenewdaq=$auxpathnewdaq/${date}.DRIVE_CONTROL_SOURCE_POSITION.fits47 43 # drive file with information tracking position 48 44 drivefile2=$auxpath/${date}.DRIVE_CONTROL_TRACKING_POSITION.fits 49 drivefilenewdaq2=$auxpathnewdaq/${date}.DRIVE_CONTROL_TRACKING_POSITION.fits50 45 # file with magic weather information 51 46 mweatherfile=$auxpath/${date}.MAGIC_WEATHER_DATA.fits 52 mweatherfilenewdaq=$auxpathnewdaq/${date}.MAGIC_WEATHER_DATA.fits53 47 # file with trigger rates 54 48 ratesfile=$auxpath/${date}.FTM_CONTROL_TRIGGER_RATES.fits 55 ratesfilenewdaq=$auxpathnewdaq/${date}.FTM_CONTROL_TRIGGER_RATES.fits56 49 # file with trigger rates 57 50 tempfile=$auxpath/${date}.FSC_CONTROL_TEMPERATURE.fits 58 tempfilenewdaq=$auxpathnewdaq/${date}.FSC_CONTROL_TEMPERATURE.fits59 51 # file with trigger rates 60 52 humfile=$auxpath/${date}.FSC_CONTROL_HUMIDITY.fits 61 humfilenewdaq=$auxpathnewdaq/${date}.FSC_CONTROL_HUMIDITY.fits62 53 63 54 function rsync_aux_file() … … 66 57 then 67 58 printprocesslog "INFO rsync "$1 68 # rsync 69 # from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/ 70 # to daq (/daq = /loc_data on daq) 71 rsyncservernewdaq=`echo $1 | sed -e 's/^\//172.16.100.100::/'` 72 # old 73 if ! rsync -a -T $rsynctempdir $1 $2 74 # new (workaround for problems on daq) 75 #if ! rsync -a -T $rsynctempdir $rsyncservernewdaq $2 59 if ! rsync -a -T $rsynctempdir newdaq:$1 $1 76 60 then 77 61 printprocesslog "WARN rsync of "$1" failed." … … 80 64 } 81 65 82 function check_d aq()66 function check_disks() 83 67 { 84 diskusage=( `df -P /raid10 | grep raid10 ` ) 85 # check if more than 700 GB are left on /loc_data 86 if [ ${diskusage[3]} -lt $disklimitdaq ] 68 # put here the check for /scratch (output of rsync) and /data1 (output of analysis) 69 70 # at least 10% free disk on /scratch 71 diskusage=( `df -P /scratch | grep scratch ` ) 72 if [ ${diskusage[3]} -lt $disklimitnewdata ] 87 73 then 88 echo "WARN less than 700 left on /raid10on node "$HOSTNAME89 printprocesslog "WARN less than 700 left on /raid10on node "$HOSTNAME90 df -h / raid1074 echo "WARN less than 10% left on /scratch on node "$HOSTNAME 75 printprocesslog "WARN less than 10% left on /scratch on node "$HOSTNAME 76 df -h /scratch 91 77 finish 92 78 fi 79 # at least 5% free disk on /data1 80 diskusage=( `df -P /data1 | grep data1 ` ) 81 if [ ${diskusage[3]} -lt $disklimitnewdata2 ] 82 then 83 echo "WARN less than 5% left on /data1 on node "$HOSTNAME 84 printprocesslog "WARN less than 5% left on /data1 on node "$HOSTNAME 85 df -h /scratch 86 finish 87 fi 93 88 } 94 89 95 check_daq 96 90 check_disks 91 92 # getting lists of files 97 93 printprocesslog "INFO get lists of raw files on newdaq and daq" 98 files=( `find $rawpathnewdaq -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort` ) 99 # to treat links use: 100 #files=( `find -L $rawpathnewdaq -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort` ) 101 94 files=( `ssh newdaq "find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort "` ) 102 95 if [ ${#files[@]} -eq 0 ] 103 96 then … … 105 98 finish 106 99 fi 107 fileslocal=( `find -L $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null| sort` )108 109 callistofiles=( `find $calpath -type f -name $date*-calibration.log 2>/dev/null| sort` ) 100 fileslocal=( `find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort` ) 101 callistofiles=( `find $calpath -type f -name $date*-calibration.log 2>/dev/null | sort` ) 102 110 103 # get number of dataruns from DB 111 104 query="SELECT Count(*) FROM RunInfo WHERE fNight="$date" AND fRunTypeKey=1" … … 124 117 makedir $rawpath >/dev/null 125 118 126 #echo "INFO #files- daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated127 printprocesslog "INFO #files- daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated119 #echo "INFO #files-local:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated 120 printprocesslog "INFO #files-local:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated 128 121 129 122 while [ ${#fileslocal[@]} -ne ${#files[@]} ] || [ $numcalibrated -ne ${#callistofiles[@]} ] # || [ $numcalibrated -ne 0 ] # FIXME: Logik ueberdenken u ueberarb … … 132 125 # when there is more than 10% space on daq 133 126 source `dirname $0`/../Sourcefile.sh 134 check_d aq127 check_disks 135 128 136 129 numcalibrated=0 … … 138 131 printprocesslog "INFO status beginning of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated 139 132 140 rsync_aux_file $drivefile newdaq $drivefile141 rsync_aux_file $drivefile newdaq2 $drivefile2133 rsync_aux_file $drivefile 134 rsync_aux_file $drivefile2 142 135 143 136 # files on newdaq … … 145 138 do 146 139 printprocesslog "processing "$file 147 #echo "processing "$file 148 localfile=`echo $file | sed -e 's/newdaq/loc_data/'` 140 echo "processing "$file 141 #localfile=`echo $file | sed -e 's/newdaq/scratch/'` 142 localfile=$file 149 143 150 144 source `dirname $0`/../Sourcefile.sh … … 158 152 then 159 153 nondrs=`basename $file | sed -e 's/[.]drs//g'` 160 nondrsfile=`find -L $rawpath -name $nondrs.*z `154 nondrsfile=`find -L $rawpath -name $nondrs.*z 2>/dev/null ` 161 155 tstop=`$factpath/fitsdump -h $nondrsfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 162 156 else … … 170 164 # if a file is not closed and not touched for 30 minutes, 171 165 # it is assumed corrupted and still transferred 172 fileaccessed=`find $file -amin -30 `166 fileaccessed=`find $file -amin -30 2>/dev/null ` 173 167 if ! [ "$fileaccessed" == "" ] 174 168 then … … 182 176 183 177 # rsync 184 # from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/ 185 # to daq (/daq = /loc_data on daq) 186 # to access rsync server via the dedicated network between 187 # daq and newdaq, use 172.16.100.100::newdaq 188 filersyncserver=`echo $file | sed -e 's/^\//172.16.100.100::/'` 189 # old 190 ##if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile 191 if ! rsync -a -T $rsynctempdir --bwlimit=$bwlimit $file $localfile 192 # new 193 #if ! rsync -a -W -T $rsynctempdir --bwlimit=$bwlimit $filersyncserver $localfile 178 if ! rsync -au -T $rsynctempdir --bwlimit=$bwlimit newdaq:$file $localfile 194 179 then 195 180 printprocesslog "ERROR something went wrong with rsync of "$file … … 210 195 # then 211 196 # nondrs=`basename $file | sed -e 's/[.]drs//g'` 212 # nondrsfile=`find -L $rawpath -name $nondrs.*z `197 # nondrsfile=`find -L $rawpath -name $nondrs.*z 2>/dev/null ` 213 198 # tstop=`$factpath/fitsdump -h $nondrsfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 214 199 # else … … 282 267 if ! [ -e $callistolog ] 283 268 then 284 rsync_aux_file $drivefile newdaq $drivefile285 rsync_aux_file $drivefile newdaq2 $drivefile2286 rsync_aux_file $mweatherfile newdaq $mweatherfile287 rsync_aux_file $ratesfile newdaq $ratesfile288 rsync_aux_file $tempfile newdaq $tempfile289 rsync_aux_file $humfilenewdaq$humfile269 rsync_aux_file $drivefile 270 rsync_aux_file $drivefile2 271 rsync_aux_file $mweatherfile 272 rsync_aux_file $ratesfile 273 rsync_aux_file $tempfile 274 rsync_aux_file $humfile 290 275 291 276 calfile=$calpath"/"$date"_"$runnum"_C.root" … … 366 351 # get new file lists 367 352 printprocesslog "INFO get new file lists for "$datepath 368 files=( ` find $rawpathnewdaq -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' | sort` )369 fileslocal=( `find -L $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?'| sort` )370 callistofiles=( `find $calpath -type f -name $date*-calibration.log | sort` )353 files=( `ssh newdaq "find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort "` ) 354 fileslocal=( `find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort` ) 355 callistofiles=( `find $calpath -type f -name $date*-calibration.log 2>/dev/null | sort` ) 371 356 #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated 372 357 printprocesslog "INFO status after for-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated … … 379 364 sleep 60 380 365 printprocesslog "INFO get new file lists for "$datepath 381 files=( ` find $rawpathnewdaq -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' | sort` )382 fileslocal=( `find -L $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?'| sort` )383 callistofiles=( `find $calpath -type f -name $date*-calibration.log | sort` )366 files=( `ssh newdaq "find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort "` ) 367 fileslocal=( `find $rawpath -type f -regex '.*20[0-9][0-9][01][0-9][0-3][0-9][_][0-9][0-9][0-9][.]d?r?s?[.]?fits[.]?[g]?[f]?[z]?' 2>/dev/null | sort` ) 368 callistofiles=( `find $calpath -type f -name $date*-calibration.log 2>/dev/null | sort` ) 384 369 fi 385 370 #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated … … 390 375 391 376 392 377 finish
Note:
See TracChangeset
for help on using the changeset viewer.