Changeset 16678
- Timestamp:
- 06/03/13 22:40:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Transfer/CheckTransfer.sh
r15599 r16678 7 7 printprocesslog "INFO starting $0" 8 8 9 source /home_nfs/isdc/fact_opr/myagent.sh 9 logfile2=$logpath"/transfer/CheckTransfer.log" 10 date > $logfile2 2>&1 11 12 diskusage=( `ssh fact@161.72.93.131 "df -P /daq" | grep daq ` ) 13 # check if more than X GB are left on /daq 14 if [ ${diskusage[3]} -lt 700000 ] 15 then 16 printprocesslog "WARN less than 700 GB left on /daq " 17 echo "WARN less than 700 GB left on /daq " 18 echo "WARN less than 700 GB left on /daq " >> $logfile2 2>&1 19 sendemail="yes" 20 fi 21 22 diskusage2=( `df -P /scratch | grep scratch ` ) 23 # check if more than X GB are left on /scratch 24 if [ ${diskusage2[3]} -lt 500000 ] 25 then 26 printprocesslog "WARN less than 500 GB left on /scratch " 27 echo "WARN less than 500 GB left on /scratch " 28 echo "WARN less than 500 GB left on /scratch " >> $logfile2 2>&1 29 sendemail="yes" 30 fi 31 32 # needed for transfer to phido 33 #source /home_nfs/isdc/fact_opr/myagent.sh 10 34 11 35 # check first the disk in LP and on dl00 … … 13 37 df -h /scratch 14 38 echo "" 39 echo "" >> $logfile2 2>&1 15 40 16 41 # check next the DB to know if some transfer processes failed or crashed … … 26 51 # echo $run 27 52 #done 53 sendemail="yes" 28 54 echo -e "\e[1;31m\x1b[5m ==>\e[00m "$1": "${runs[@]}"\e[1;31m\x1b[5m <==\e[00m " 29 echo "SELECT fNight, fRunId FROM "$1" "$where";"55 echo "SELECT fNight, fRunId, fStartTime, fStopTime, fReturnCode FROM "$1" "$where";" 30 56 echo "UPDATE "$1" SET fStartTime=NULL, fStopTime=NULL, fAvailable=NULL, fReturnCode=NULL, fProcessingSiteKey=NULL "$where";" 57 echo -e " ==> "$1": "${runs[@]}" <== " >> $logfile2 2>&1 58 echo "---> Please check the DB and reset the processes if needed. " >> $logfile2 2>&1 59 echo "to check: SELECT fNight, fRunId, fStartTime, fStopTime, fReturnCode FROM "$1" "$where";" >> $logfile2 2>&1 60 echo "to reset: UPDATE "$1" SET fStartTime=NULL, fStopTime=NULL, fAvailable=NULL, fReturnCode=NULL, fProcessingSiteKey=NULL "$where";" >> $logfile2 2>&1 31 61 fi 32 62 } … … 41 71 # RawFileAvailISDC needs a different treatment 42 72 # as return code 0 means that file is in fails folder in archive 43 where="WHERE fReturnCode>0 OR (NOT ISNULL(fStartTime) AND ISNULL(fStopTime)) "73 where="WHERE fReturnCode>0 OR (NOT ISNULL(fStartTime) AND ISNULL(fStopTime)) AND fStartTime < DATE_ADD(Now(), INTERVAL -1 HOUR) " 44 74 check_runs_in_db "RawFileAvailISDCStatus" 45 75 … … 55 85 dates=( `ssh fact@161.72.93.131 "find /loc_data/zipraw -mindepth 3 -type d | sort | sed -e 's/\/loc_data\/zipraw\///g' "` ) 56 86 57 #dates=( "2013/04/18" )87 dates=( "2013/05/23" ) 58 88 #short="yes" 59 89 … … 64 94 for date in ${dates[@]} 65 95 do 66 echo "" 67 echo "" 68 echo "" 69 echo $date 96 logfile=$logpath"/transfer/CheckTransfer_"`echo $date | sed -e 's/\//-/g'`".log" 97 #echo "" 98 #echo "" 99 #echo "" 100 #echo $date 101 #echo "" > $logfile 2>&1 102 #echo "" >> $logfile 2>&1 103 #echo "" >> $logfile 2>&1 104 echo $date > $logfile 2>&1 70 105 71 106 # some counters … … 79 114 if [ $numdaysok -ge $numdaysoklimit ] && [ $(echo " $sumdata > $checklimit " | bc -l) -eq 1 ] 80 115 then 81 echo"INFO more than "$numdaysoklimit" ok and more than "$checklimit" GB checked. "116 printprocesslog "INFO more than "$numdaysoklimit" ok and more than "$checklimit" GB checked. " 82 117 continue 83 118 fi … … 102 137 if [ ${newdaq[0]} -eq -1 ] && [ ${daq[0]} -eq -1 ] 103 138 then 104 echo "INFO no data available on newdaq for "$date 139 printprocesslog "INFO no data available on newdaq for "$date 140 echo "INFO no data available on newdaq for "$date >> $logfile 2>&1 105 141 continue 106 142 fi 107 zip=( `ssh fact@161.72.93.131 "if [ -d $lpziprawpath ]; then ls $lpziprawpath/* | wc -l; du -s -b --apparent-size $lpziprawpath; else echo '-1 -1 -1'; fi"` )143 zip=( `ssh fact@161.72.93.131 "if [ -d $lpziprawpath ]; then ls $lpziprawpath/* 2>/dev/null | wc -l; du -s -b --apparent-size $lpziprawpath; else echo '-1 -1 -1'; fi"` ) 108 144 dl00=( `if [ -d $localrawpath ]; then ls $localrawpath/* | wc -l; du -s -b --apparent-size $localrawpath; else echo '-1 -1 -1'; fi` ) 109 archive=( `if [ -d $localrawpath3 ]; then ls $localrawpath3/* | wc -l; du -L -s -b --apparent-size $localrawpath3; else echo '-1 -1 -1'; fi` )145 archive=( `if [ -d $localrawpath3 ]; then ls $localrawpath3/* 2>/dev/null | wc -l; du -L -s -b --apparent-size $localrawpath3; else echo '-1 -1 -1'; fi` ) 110 146 fails=( `if [ -d $localfailpath ]; then ls $localfailpath/* | wc -l; du -L -s -b --apparent-size $localfailpath; else echo '-1 -1 -1'; fi` ) 111 147 wue=( `ssh operator@coma.astro.uni-wuerzburg.de "if [ -d $wuerawpath ]; then ls $wuerawpath/* | wc -l; du -s -b --apparent-size $wuerawpath; else echo '-1 -1 -1'; fi"` ) … … 144 180 # numphido=0 145 181 #fi 146 echo "disk: " 147 echo " newdaq "${newdaq[@]} 148 echo " daq "${daq[@]} 149 echo " data "${zip[@]} 150 echo " dl00 "${dl00[@]} 151 echo " wue "${wue[@]} 152 echo " arch "${archive[@]} 153 echo " fail "${fails[@]} 154 #echo " phido "${phido[@]} 155 echo "db: " 156 echo " runinfo "$numruns 157 echo " rsynced "$numrsynced 158 echo " isdc "$numisdc 159 echo " wue "$numwue 160 #echo " phido "$numphido 182 183 printprocesslog "disk: " 184 printprocesslog " newdaq "${newdaq[@]} 185 printprocesslog " daq "${daq[@]} 186 printprocesslog " data "${zip[@]} 187 printprocesslog " dl00 "${dl00[@]} 188 printprocesslog " wue "${wue[@]} 189 printprocesslog " arch "${archive[@]} 190 printprocesslog " fail "${fails[@]} 191 #printprocesslog " phido "${phido[@]} 192 printprocesslog "db: " 193 printprocesslog " runinfo "$numruns 194 printprocesslog " rsynced "$numrsynced 195 printprocesslog " isdc "$numisdc 196 printprocesslog " wue "$numwue 197 #printprocesslog " phido "$numphido 198 echo "disk: " >> $logfile 2>&1 199 echo " newdaq "${newdaq[@]} >> $logfile 2>&1 200 echo " daq "${daq[@]} >> $logfile 2>&1 201 echo " data "${zip[@]} >> $logfile 2>&1 202 echo " dl00 "${dl00[@]} >> $logfile 2>&1 203 echo " wue "${wue[@]} >> $logfile 2>&1 204 echo " arch "${archive[@]} >> $logfile 2>&1 205 echo " fail "${fails[@]} >> $logfile 2>&1 206 #echo " phido "${phido[@]} >> $logfile 2>&1 207 echo "db: " >> $logfile 2>&1 208 echo " runinfo "$numruns >> $logfile 2>&1 209 echo " rsynced "$numrsynced >> $logfile 2>&1 210 echo " isdc "$numisdc >> $logfile 2>&1 211 echo " wue "$numwue >> $logfile 2>&1 212 #echo " phido "$numphido >> $logfile 2>&1 161 213 162 214 # check if file are available in the different places 163 215 if [ ${dl00[0]} -eq -1 ] && [ $date2 -lt 20120308 ] 164 216 then 165 echo "INFO data not available on /scratch on dl00 for "$date 217 printprocesslog "INFO data not available on /scratch on dl00 for "$date 218 echo "INFO data not available on /scratch on dl00 for "$date >> $logfile 2>&1 166 219 fi 167 220 if [ ${archive[0]} -eq -1 ] 168 221 then 169 echo "INFO data not in archive for "$date 222 printprocesslog "INFO data not in archive for "$date 223 echo "INFO data not in archive for "$date >> $logfile 2>&1 170 224 fi 171 225 … … 174 228 if ! [ ${daq[0]} -eq -1 ] && ! [ ${daq[0]} -eq ${newdaq[0]} ] 175 229 then 176 echo "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date 230 printprocesslog "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date 231 echo "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date >> $logfile 2>&1 177 232 numpb=`echo " $numpb + 1 " | bc -l ` 178 result ="1"233 result1="1" 179 234 else 180 235 numok=`echo " $numok + 1 " | bc -l ` 181 result ="0"236 result1="0" 182 237 fi 183 238 # dl00 184 if ! [ ${dl00[0]} -eq -1 ] && ! [ ${dl00[0]} -eq ${newdaq[0]} ] 185 then 186 echo "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 239 #if ! [ ${dl00[0]} -eq -1 ] && ! [ ${dl00[0]} -eq ${newdaq[0]} ] 240 if ! [ ${dl00[0]} -eq ${newdaq[0]} ] 241 then 242 printprocesslog "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 243 echo "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1 187 244 numpb=`echo " $numpb + 1 " | bc -l ` 188 result =$result"1"245 result1=$result1"1" 189 246 else 190 247 numok=`echo " $numok + 1 " | bc -l ` 191 result =$result"0"248 result1=$result1"0" 192 249 fi 193 250 # archive 194 251 if ! [ ${archive[0]} -eq -1 ] && ! [ ${archive[0]} -eq ${newdaq[0]} ] 195 252 then 196 echo "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 253 printprocesslog "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 254 echo "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1 197 255 #check /archive/rev_1/failed 198 256 if ! [ ${fails[0]} -eq -1 ] … … 201 259 if ! [ $sum -eq ${newdaq[0]} ] 202 260 then 203 echo "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")." 261 printprocesslog "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")." 262 echo "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")." >> $logfile 2>&1 204 263 numpb=`echo " $numpb + 1 " | bc -l ` 205 result =$result"1"264 result1=$result1"1" 206 265 else 207 266 numok=`echo " $numok + 1 " | bc -l ` 208 result =$result"0"209 fi 210 else 211 result =$result"1"267 result1=$result1"0" 268 fi 269 else 270 result1=$result1"1" 212 271 fi 213 272 else … … 215 274 then 216 275 numpb=`echo " $numpb + 1 " | bc -l ` 217 result =$result"1"218 else 219 numok=`echo " $numok + 1 " | bc -l ` 220 result =$result"0"276 result1=$result1"1" 277 else 278 numok=`echo " $numok + 1 " | bc -l ` 279 result1=$result1"0" 221 280 fi 222 281 fi 223 282 # wue 224 if ! [ ${wue[0]} -eq -1 ] && ! [ ${wue[0]} -eq ${newdaq[0]} ] 225 then 226 echo "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 283 #if ! [ ${wue[0]} -eq -1 ] && ! [ ${wue[0]} -eq ${newdaq[0]} ] 284 if ! [ ${wue[0]} -eq ${newdaq[0]} ] 285 then 286 printprocesslog "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 287 echo "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1 227 288 numpb=`echo " $numpb + 1 " | bc -l ` 228 result =$result"1"289 result1=$result1"1" 229 290 else 230 291 numok=`echo " $numok + 1 " | bc -l ` 231 result =$result"0"292 result1=$result1"0" 232 293 fi 233 294 ## phido 234 295 #if ! [ ${phido[0]} -eq -1 ] && ! [ ${phido[0]} -eq ${newdaq[0]} ] 235 296 #then 236 # echo "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 297 # printprocesslog "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date 298 # echo "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1 237 299 # numpb=`echo " $numpb + 1 " | bc -l ` 238 # result =$result"1"300 # result1=$result1"1" 239 301 #else 240 302 # numok=`echo " $numok + 1 " | bc -l ` 241 # result =$result"0"303 # result1=$result1"0" 242 304 #fi 243 305 244 if [ "$short" = "yes" ] || [ "$result" != "0000" ] 245 then 246 echo $result 306 if [ "$short" = "yes" ] || [ "$result1" != "0000" ] 307 then 308 printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking." 309 echo "number of files does not yet agree in all sites ("$result1") -> do no further checking." >> $logfile 2>&1 310 echo "" 311 echo "SUMMARY for "$date 312 echo "-----------------------" 313 echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) " 314 echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile 315 echo "" >> $logfile 2>&1 316 echo "SUMMARY for "$date >> $logfile 2>&1 317 echo "-----------------------" >> $logfile 2>&1 318 echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) " >> $logfile 2>&1 319 echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile 2>&1 320 echo "" >> $logfile2 2>&1 321 echo "SUMMARY for "$date >> $logfile2 2>&1 322 echo "-----------------------" >> $logfile2 2>&1 323 echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) " >> $logfile2 2>&1 324 echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile2 2>&1 325 #echo "number of files does not yet agree in all sites ("$result1") -> do no further checking. " 326 #echo "disk: " 327 #echo " newdaq "${newdaq[@]} 328 #echo " daq "${daq[@]} 329 #echo " data "${zip[@]} 330 #echo " dl00 "${dl00[@]} 331 #echo " wue "${wue[@]} 332 #echo " arch "${archive[@]} 333 #echo " fail "${fails[@]} 334 ##echo " phido "${phido[@]} 335 #echo "db: " 336 #echo " runinfo "$numruns 337 #echo " rsynced "$numrsynced 338 #echo " isdc "$numisdc 339 #echo " wue "$numwue 340 ##echo " phido "$numphido 247 341 continue 248 342 fi 249 343 250 result=$result"-"344 #result=$result"-" 251 345 # check du for raw files 252 346 # la palma 253 347 if ! [ ${newdaq[1]} -eq ${daq[1]} ] 254 348 then 255 echo "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date 349 printprocesslog "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date 350 echo "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date >> $logfile 2>&1 256 351 numdiff=`echo " $numdiff + 1 " | bc -l ` 257 352 numpb=`echo " $numpb + 1 " | bc -l ` 258 result =$result"1"353 result2="1" 259 354 else 260 355 numok=`echo " $numok + 1 " | bc -l ` 261 result =$result"0"356 result2="0" 262 357 fi 263 358 # check du for zipped raw files … … 265 360 if ! [ ${zip[1]} -eq ${dl00[1]} ] && [ $date2 -gt 20120307 ] 266 361 then 267 echo "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date 362 printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date 363 echo "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date >> $logfile 2>&1 268 364 if ! [ ${dl00[1]} -eq -1 ] 269 365 then 270 366 numdiff=`echo " $numdiff + 1 " | bc -l ` 271 367 numpb=`echo " $numpb + 1 " | bc -l ` 272 result =$result"1"273 else 274 numok=`echo " $numok + 1 " | bc -l ` 275 result =$result"0"368 result2=$result2"1" 369 else 370 numok=`echo " $numok + 1 " | bc -l ` 371 result2=$result2"0" 276 372 fi 277 373 else 278 374 numok=`echo " $numok + 1 " | bc -l ` 279 result =$result"0"375 result2=$result2"0" 280 376 fi 281 377 # archive 282 378 if ! [ ${zip[1]} -eq ${archive[1]} ] 283 379 then 284 echo "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date 380 printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date 381 echo "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date >> $logfile 2>&1 285 382 if ! [ ${archive[1]} -eq -1 ] 286 383 then 287 384 numdiff=`echo " $numdiff + 1 " | bc -l ` 288 385 numpb=`echo " $numpb + 1 " | bc -l ` 289 result =$result"1"290 else 291 numok=`echo " $numok + 1 " | bc -l ` 292 result =$result"0"386 result2=$result2"1" 387 else 388 numok=`echo " $numok + 1 " | bc -l ` 389 result2=$result2"0" 293 390 fi 294 391 else 295 392 numok=`echo " $numok + 1 " | bc -l ` 296 result =$result"0"393 result2=$result2"0" 297 394 fi 298 395 # wue 299 396 if ! [ ${zip[1]} -eq ${wue[1]} ] 300 397 then 301 echo "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date 398 printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date 399 echo "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date >> $logfile 2>&1 302 400 if ! [ ${wue[1]} -eq -1 ] 303 401 then 304 402 numdiff=`echo " $numdiff + 1 " | bc -l ` 305 403 numpb=`echo " $numpb + 1 " | bc -l ` 306 result =$result"1"307 else 308 numok=`echo " $numok + 1 " | bc -l ` 309 result =$result"0"404 result2=$result2"1" 405 else 406 numok=`echo " $numok + 1 " | bc -l ` 407 result2=$result2"0" 310 408 fi 311 409 else 312 410 numok=`echo " $numok + 1 " | bc -l ` 313 result =$result"0"411 result2=$result2"0" 314 412 fi 315 413 ## phido 316 414 #if ! [ ${zip[1]} -eq ${phido[1]} ] 317 415 #then 318 # echo "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date 416 # printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date 417 # echo "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date >> $logfile 2>&1 319 418 # if ! [ ${phido[1]} -eq -1 ] 320 419 # then 321 420 # numdiff=`echo " $numdiff + 1 " | bc -l ` 322 421 # numpb=`echo " $numpb + 1 " | bc -l ` 323 # result =$result"1"422 # result2=$result2"1" 324 423 # else 325 424 # numok=`echo " $numok + 1 " | bc -l ` 326 # result =$result"0"425 # result2=$result2"0" 327 426 # fi 328 427 #else 329 428 # numok=`echo " $numok + 1 " | bc -l ` 330 # result =$result"0"429 # result2=$result2"0" 331 430 #fi 332 result=$result"-"431 #result=$result"-" 333 432 334 433 # check DB (only starting from 8.3.2012) (if-clause to be removed later) … … 338 437 if ! [ $numruns -eq ${newdaq[0]} ] 339 438 then 340 echo "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" 341 numpb=`echo " $numpb + 1 " | bc -l ` 342 result=$result"1" 343 else 344 numok=`echo " $numok + 1 " | bc -l ` 345 result=$result"0" 439 printprocesslog "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" 440 echo "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" >> $logfile 2>&1 441 numpb=`echo " $numpb + 1 " | bc -l ` 442 result3="1" 443 else 444 numok=`echo " $numok + 1 " | bc -l ` 445 result3="0" 346 446 fi 347 447 # dl00 348 448 if ! [ $numruns -eq $numrsynced ] 349 449 then 350 echo "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" 351 numpb=`echo " $numpb + 1 " | bc -l ` 352 result=$result"1" 353 else 354 numok=`echo " $numok + 1 " | bc -l ` 355 result=$result"0" 450 printprocesslog "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" 451 echo "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1 452 numpb=`echo " $numpb + 1 " | bc -l ` 453 result3=$result3"1" 454 else 455 numok=`echo " $numok + 1 " | bc -l ` 456 result3=$result3"0" 356 457 fi 357 458 # archive 358 459 if ! [ $numruns -eq $numisdc ] 359 460 then 360 echo "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" 361 numpb=`echo " $numpb + 1 " | bc -l ` 362 result=$result"1" 363 else 364 numok=`echo " $numok + 1 " | bc -l ` 365 result=$result"0" 461 printprocesslog "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" 462 echo "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" >> $logfile 2>&1 463 numpb=`echo " $numpb + 1 " | bc -l ` 464 result3=$result3"1" 465 else 466 numok=`echo " $numok + 1 " | bc -l ` 467 result3=$result3"0" 366 468 fi 367 469 # wue 368 470 if ! [ $numruns -eq $numwue ] 369 471 then 370 echo "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" 371 numpb=`echo " $numpb + 1 " | bc -l ` 372 result=$result"1" 373 else 374 numok=`echo " $numok + 1 " | bc -l ` 375 result=$result"0" 472 printprocesslog "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" 473 echo "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1 474 numpb=`echo " $numpb + 1 " | bc -l ` 475 result3=$result3"1" 476 else 477 numok=`echo " $numok + 1 " | bc -l ` 478 result3=$result3"0" 376 479 fi 377 480 ## phido 378 481 #if ! [ $numruns -eq $numphido ] 379 482 #then 380 # echo "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" 483 # printprocesslog "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" 484 # echo "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1 381 485 # numpb=`echo " $numpb + 1 " | bc -l ` 382 # result =$result"1"486 # result3=$result3"1" 383 487 #else 384 488 # numok=`echo " $numok + 1 " | bc -l ` 385 # result =$result"0"489 # result3=$result3"0" 386 490 #fi 387 491 fi 388 492 389 493 #numdiff=0 # add for debugging so that single file sizes are not checked 390 echo "numdiff: "$numdiff 391 echo "INFO numok: "$numok 392 echo "INFO numpb: "$numpb 494 printprocesslog "numdiff: "$numdiff 495 printprocesslog "INFO numok: "$numok 496 printprocesslog "INFO numpb: "$numpb 497 echo "numdiff: "$numdiff >> $logfile 2>&1 498 echo "INFO numok: "$numok >> $logfile 2>&1 499 echo "INFO numpb: "$numpb >> $logfile 2>&1 393 500 #if [ $numdiff -gt 0 ] 394 501 if [ $numdiff -ge 0 ] … … 406 513 daqdiffcounter=0 407 514 daqokcounter=0 408 echo "INFO found "${#runs[@]}" rawfiles in DB." 515 printprocesslog "INFO found "${#runs[@]}" rawfiles in DB." 516 echo "INFO found "${#runs[@]}" rawfiles in DB." >> $logfile 2>&1 409 517 for run in ${runs[@]} 410 518 do … … 432 540 sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` ) 433 541 fi 434 # echo "vgl "$run": "$sizezip" - "$sizearchive435 542 #if ! [ ${phido[1]} -eq -1 ] 436 543 #then … … 442 549 if ! [ "$sizenewdaq" = "$sizedaq" ] 443 550 then 444 echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" 551 printprocesslog " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" 552 echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1 445 553 daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l ` 446 554 else … … 450 558 if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ] 451 559 then 452 echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" 560 printprocesslog " "$rawfile2" data("$sizezip") dl00("$sizedl00")" 561 echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1 453 562 dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l ` 454 563 else … … 460 569 if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ] 461 570 then 462 echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" 463 echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]} 571 printprocesslog " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" 572 echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1 573 #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]} 464 574 archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l ` 465 575 else … … 469 579 if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ] 470 580 then 471 echo " "$rawfile2" data("$sizezip") wue("$sizewue")" 581 printprocesslog " "$rawfile2" data("$sizezip") wue("$sizewue")" 582 echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1 472 583 wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l ` 473 584 else … … 477 588 #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ] 478 589 #then 479 # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" 590 # printprocesslog " "$rawfile2" data("$sizezip") phido("$sizephido")" 591 # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1 480 592 # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l ` 481 593 #else … … 485 597 query="SELECT fRunID FROM RunInfo WHERE fNight="$date2" AND fHasDrsFile=1" 486 598 drsruns=( `sendquery` ) 487 echo "INFO found "${#drsruns[@]}" drsfiles in DB." 599 printprocesslog "INFO found "${#drsruns[@]}" drsfiles in DB." 600 echo "INFO found "${#drsruns[@]}" drsfiles in DB." >> $logfile 2>&1 488 601 for drsrun in ${drsruns[@]} 489 602 do … … 519 632 if ! [ "$sizenewdaq" = "$sizedaq" ] 520 633 then 521 echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" 634 printprocesslog " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" 635 echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1 522 636 daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l ` 523 637 else … … 527 641 if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ] 528 642 then 529 echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" 643 printprocesslog " "$rawfile2" data("$sizezip") dl00("$sizedl00")" 644 echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1 530 645 dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l ` 531 646 else … … 535 650 if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ] 536 651 then 537 echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" 652 printprocesslog " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" 653 echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1 538 654 archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l ` 539 655 else … … 543 659 if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ] 544 660 then 545 echo " "$rawfile2" data("$sizezip") wue("$sizewue")" 661 printprocesslog " "$rawfile2" data("$sizezip") wue("$sizewue")" 662 echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1 546 663 wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l ` 547 664 else … … 551 668 #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ] 552 669 #then 553 # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" 670 # printprocesslog " "$rawfile2" data("$sizezip") phido("$sizephido")" 671 # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1 554 672 # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l ` 555 673 #else … … 558 676 done 559 677 560 result=$result"-"678 #result=$result"-" 561 679 # raw files 562 680 if [ $daqokcounter -eq ${daq[0]} ] 563 681 then 564 682 numok=`echo " $numok + 1 " | bc -l ` 565 result =$result"0"566 else 567 result =$result"1"683 result4="0" 684 else 685 result4="1" 568 686 numpb=`echo " $numpb + 1 " | bc -l ` 569 687 fi … … 572 690 if [ $dl00okcounter -eq ${dl00[0]} ] 573 691 then 574 result =$result"0"575 numok=`echo " $numok + 1 " | bc -l ` 576 else 577 result =$result"1"692 result4=$result4"0" 693 numok=`echo " $numok + 1 " | bc -l ` 694 else 695 result4=$result4"1" 578 696 numpb=`echo " $numpb + 1 " | bc -l ` 579 697 fi … … 587 705 if [ $archiveokcounter -eq ${daq[0]} ] 588 706 then 589 result =$result"0"590 numok=`echo " $numok + 1 " | bc -l ` 591 else 592 result =$result"1"707 result4=$result4"0" 708 numok=`echo " $numok + 1 " | bc -l ` 709 else 710 result4=$result4"1" 593 711 numpb=`echo " $numpb + 1 " | bc -l ` 594 712 fi … … 596 714 if [ $wueokcounter -eq ${wue[0]} ] 597 715 then 598 result =$result"0"599 numok=`echo " $numok + 1 " | bc -l ` 600 else 601 result =$result"1"716 result4=$result4"0" 717 numok=`echo " $numok + 1 " | bc -l ` 718 else 719 result4=$result4"1" 602 720 numpb=`echo " $numpb + 1 " | bc -l ` 603 721 fi … … 605 723 #if [ $phidookcounter -eq ${phido[0]} ] 606 724 #then 607 # result =$result"0"725 # result4=$result4"0" 608 726 # numok=`echo " $numok + 1 " | bc -l ` 609 727 #else 610 # result =$result"1"728 # result4=$result4"1" 611 729 # numpb=`echo " $numpb + 1 " | bc -l ` 612 730 #fi 613 echo "INFO "$daqokcounter" files are ok on daq (raw)." 614 echo "INFO "$dl00okcounter" files are ok on dl00." 615 echo "INFO "$wueokcounter" files are ok in Wue." 616 echo "INFO "$archiveokcounter" files are ok in the archive." 617 #echo "INFO "$phidookcounter" files are ok on Phido." 618 echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." 619 echo "WARN "$dl00diffcounter" files have a different size on dl00." 620 echo "WARN "$wuediffcounter" files have a different size in Wue." 621 echo "WARN "$archivediffcounter" files have a different size in the archive." 622 #echo "WARN "$phidodiffcounter" files have a different size on Phido." 731 printprocesslog "INFO "$daqokcounter" files are ok on daq (raw)." 732 printprocesslog "INFO "$dl00okcounter" files are ok on dl00." 733 printprocesslog "INFO "$wueokcounter" files are ok in Wue." 734 printprocesslog "INFO "$archiveokcounter" files are ok in the archive." 735 #printprocesslog "INFO "$phidookcounter" files are ok on Phido." 736 printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)." 737 printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00." 738 printprocesslog "WARN "$wuediffcounter" files have a different size in Wue." 739 printprocesslog "WARN "$archivediffcounter" files have a different size in the archive." 740 #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido." 741 echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1 742 echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1 743 echo "INFO "$wueokcounter" files are ok in Wue." >> $logfile 2>&1 744 echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1 745 #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1 746 echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1 747 echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1 748 echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1 749 echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1 750 #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1 623 751 fi 624 752 625 753 # print summary: 626 echo "INFO day ok: "$numdaysok 627 echo "INFO numok: "$numok 628 echo "INFO numpb: "$numpb 629 echo "result:" 630 echo "(#files-dudir-db-filesize)" 631 #echo " ldawp-ldawp-ldawp-ldawp" 632 echo " ldaw-ldaw-ldaw-ldaw" 633 echo " "$result 754 printprocesslog "INFO day ok: "$numdaysok 755 printprocesslog "INFO numok: "$numok 756 printprocesslog "INFO numpb: "$numpb 757 printprocesslog "result:" 758 printprocesslog "(#files-dudir-db-filesize)" 759 #printprocesslog " ldawp-ldawp-ldawp-ldawp" 760 printprocesslog " ldaw-ldaw-ldaw-ldaw" 761 printprocesslog " "$result1"-"$result2"-"$result3"-"$result4 762 echo "INFO day ok: "$numdaysok >> $logfile 2>&1 763 echo "INFO numok: "$numok >> $logfile 2>&1 764 echo "INFO numpb: "$numpb >> $logfile 2>&1 765 echo "result:" >> $logfile 2>&1 766 echo "(#files-dudir-db-filesize)" >> $logfile 2>&1 767 #echo " ldawp-ldawp-ldawp-ldawp" >> $logfile 2>&1 768 echo " ldaw-ldaw-ldaw-ldaw" >> $logfile 2>&1 769 echo " "$result1"-"$result2"-"$result3"-"$result4 >> $logfile 2>&1 634 770 sumdatanew=`echo " ( ${daq[1]} + ${zip[1]} ) / 1024 / 1024 / 1024 " | bc -l | cut -d. -f1` 635 771 sumdata=`echo " $sumdata + $sumdatanew " | bc -l | cut -d. -f1` 636 echo"checked alread "$sumdata" GB. "$sumdatanew" "${daq[1]}" "${zip[1]}772 printprocesslog "checked alread "$sumdata" GB. "$sumdatanew" "${daq[1]}" "${zip[1]} 637 773 if [ $numpb -lt 4 ] 638 774 then 639 775 numdaysok=`echo " $numdaysok + 1 " | bc -l ` 640 776 fi 777 778 echo "SUMMARY for "$date 779 echo "-----------------------" 780 echo "" >> $logfile 2>&1 781 echo "SUMMARY for "$date >> $logfile 2>&1 782 echo "-----------------------" >> $logfile 2>&1 783 echo "" >> $logfile2 2>&1 784 echo "SUMMARY for "$date >> $logfile2 2>&1 785 echo "-----------------------" >> $logfile2 2>&1 786 #echo "res1:"$result1 787 #echo "res3:"$result3 788 #echo "res4:"$result4 789 #echo "arch:"${archive[0]} 790 #echo "isdc:"$numisdc 791 if [ "$result1" = "0000" ] && [ "$result3" = "0000" ] && [ "$result4" = "0000" ] 792 then 793 echo " EVERYTHING is ok. "$date" can be deleted. " 794 echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile 2>&1 795 echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile2 2>&1 796 echo " Details in the logfile "$logfile 797 echo " Details in the logfile "$logfile >> $logfile 2>&1 798 echo " Details in the logfile "$logfile >> $logfile2 2>&1 799 else 800 if [ "$result1" = "0000" ] && [ "$result3" = "0010" ] && [ "$result4" = "0000" ] && [ ${archive[0]} -eq $numisdc ] 801 then 802 echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " 803 echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile 2>&1 804 echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile2 2>&1 805 echo " TRANSFER is ok. "$date" can be deleted. " 806 echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile 2>&1 807 echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile2 2>&1 808 echo " Details in the logfile "$logfile 809 echo " Details in the logfile "$logfile >> $logfile 2>&1 810 echo " Details in the logfile "$logfile >> $logfile2 2>&1 811 else 812 echo " "$date" is not yet transfered completely. Please check the logfile "$logfile 813 echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1 814 echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1 815 echo " resetting jobs in the DB might be needed." 816 echo " resetting jobs in the DB might be needed." >> $logfile 2>&1 817 echo " resetting jobs in the DB might be needed." >> $logfile2 2>&1 818 fi 819 fi 820 if [ $daqdiffcounter -gt 0 ] 821 then 822 echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." 823 echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1 824 echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile2 2>&1 825 fi 826 if [ $dl00diffcounter -gt 0 ] 827 then 828 echo " WARN "$dl00diffcounter" files have a different size on dl00." 829 echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1 830 echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile2 2>&1 831 fi 832 if [ $wuediffcounter -gt 0 ] 833 then 834 echo " WARN "$wuediffcounter" files have a different size in Wue." 835 echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1 836 echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile2 2>&1 837 fi 838 if [ $archivediffcounter -gt 0 ] 839 then 840 echo " WARN "$archivediffcounter" files have a different size in the archive." 841 echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1 842 echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile2 2>&1 843 fi 641 844 done 642 845 846 #sendemail="yes" 847 if [ "$sendemail" = "yes" ] 848 then 849 echo "INFO send email with "$logfile2"to shift@fact-project.org " 850 printprocesslog "INFO send email with "$logfile2"to shift@fact-project.org " 851 cat $logfile2 | mail -s "testmail for info on deleting data" shift@fact-project.org 852 fi 853 643 854 printprocesslog "INFO finished $0" 644 855
Note:
See TracChangeset
for help on using the changeset viewer.