Ignore:
Timestamp:
05/24/12 12:25:00 (13 years ago)
Author:
Daniela Dorner
Message:
improved logging, removed old code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Transfer/CheckTransfer.sh

    r13580 r13862  
    2424numdaysoklimit=3
    2525sumdata=0
    26 checklimit=2000
     26checklimit=2500
    2727for date in ${dates[@]}
    2828do
     
    5252   lpziprawpath="/loc_data/zipraw/"$date
    5353   localrawpath="/scratch/from_lapalma/raw/"$date
    54    #localrawpath2="/data00/fact-construction/raw/"$date
    5554   localrawpath3="/fact/raw/"$date
    5655   localfailpath="/archive/fact/fails/raw/"$date
     
    6766   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"` )
    6867   dl00=( `if [ -d $localrawpath ]; then ls $localrawpath/* | wc -l; du -s -b --apparent-size $localrawpath; else echo '-1 -1 -1'; fi` )
    69    #data00=( `if [ -d $localrawpath2 ]; then ls $localrawpath2/* | wc -l; du -s -b --apparent-size $localrawpath2; else echo '-1 -1 -1'; fi` )
    7068   archive=( `if [ -d $localrawpath3 ]; then ls $localrawpath3/* | wc -l; du -s -b --apparent-size $localrawpath3; else echo '-1 -1 -1'; fi` )
    7169   fails=( `if [ -d $localfailpath ]; then ls $localfailpath/* | wc -l; du -s -b --apparent-size $localfailpath; else echo '-1 -1 -1'; fi` )
     
    10199   echo "  data    "${data[@]}
    102100   echo "  zip     "${zip[@]}
    103    #if [ $date2 -gt 20120307 ]
    104    #then
    105       echo "  dl00    "${dl00[@]}
    106    #else
    107    #   echo "  data00  "${data00[@]}
    108    #fi
     101   echo "  dl00    "${dl00[@]}
     102   echo "  wue     "${wue[@]}
    109103   echo "  arch    "${archive[@]}
    110104   echo "  fail    "${fails[@]}
    111    echo "  wue     "${wue[@]}
     105   echo "db: "
    112106   echo "  runinfo "$numruns
    113107   echo "  rsynced "$numrsynced
     
    120114      echo "INFO data not available on /scratch on dl00 for "$date
    121115   fi
    122    #if [ ${data00[0]} -eq -1 ] && [ $date2 -gt 20120307 ]
    123    #then
    124    #   echo "INFO data not available on /data00 for "$date
    125    #fi
    126116   if [ ${archive[0]} -eq -1 ]
    127117   then
     
    174164      result=$result"0"
    175165   fi
    176    ## /data00 (to be removed later)
    177    #if ! [ ${data00[0]} -eq -1 ]  && ! [ ${data00[0]} -eq ${daq[0]} ]
    178    #then
    179    #   echo "WARN number of files in /data00 (" ${data00[0]}") does not agree with number of files in LP (" ${daq[0]}") for "$date
    180    #fi
    181166   # wue
    182167   if ! [ ${wue[0]} -eq -1 ]  && ! [ ${wue[0]} -eq ${daq[0]} ]
     
    221206      result=$result"0"
    222207   fi
    223    ## data00 (to be removed later)
    224    #if ! [ ${zip[1]} -eq ${data00[1]} ] && [ $date2 -lt 20120308 ]
    225    #then
    226    #   echo "WARN size of data doesn't agree on data ("${zip[1]}") and /data00 ("${data00[1]}") for "$date
    227    #   if ! [ ${data00[1]} -eq -1 ]
    228    #   then
    229    #      numdiff=`echo " $numdiff + 1 " | bc -l `
    230    #   fi
    231    #fi
    232208   # archive
    233209   if ! [ ${zip[1]} -eq ${archive[1]} ]
     
    341317            sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
    342318         fi
    343          #if ! [ ${data00[1]} -eq -1 ]
    344          #then
    345          #   sizedata00=( `ls -l $localrawpath2/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
    346          #fi
    347319         if ! [ ${archive[1]} -eq -1 ]
    348320         then
     
    375347            dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
    376348         fi
    377          ## data00
    378          #if ! [ "$sizezip" = "$sizedata00" ] && ! [ ${data00[1]} -eq -1 ]
    379          #then
    380          #   echo "  "$rawfile2" data("$sizezip") data00("$sizedata00")"
    381          #fi
    382349         # archive
    383350         if [  "$sizezip" != "$sizearchive"  -a  ${archive[1]} -ne -1 ] || [  "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1  ]
    384          #if ! [ "$sizezip" = "$sizearchive" ] && ! [ ${archive[1]} -eq -1 ]
    385          then
    386             #echo "  --"$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    387             #if ! [ "$sizezip" = "$sizefails" ] && ! [ ${fails[1]} -eq -1 ]
    388             #then
    389                echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    390                archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
    391             #else
    392             #   archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
    393             #fi
     351         then
     352            echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
     353            archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
    394354         else
    395355            archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
    396356         fi
    397          #if ! [ "$sizezip" = "" ] && ! [ "$sizearchive" = "" ] && ! [ ${archive[1]} -eq -1 ]
    398          #then
    399          #   if [ $sizezip -gt $sizearchive ]
    400          #   then
    401          #      echo "ERROR "$rawfile" smaller in archive ("$sizearchive") than on data ("$sizezip")"
    402          #   fi
    403          #fi
    404357         # wue
    405358         if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
     
    426379            sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
    427380         fi
    428          #if ! [ ${data00[1]} -eq -1 ]
    429          #then
    430          #   sizedata00=( `ls -l $localrawpath2/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
    431          #fi
    432381         if ! [ ${archive[1]} -eq -1 ]
    433382         then
     
    460409            dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
    461410         fi
    462          ## data00
    463          #if ! [ "$sizezip" = "$sizedata00" ] && ! [ ${data00[1]} -eq -1 ]
    464          #then
    465          #   echo "  "$rawfile2" data("$sizezip") data00("$sizedata00")"
    466          #fi
    467          # archive
    468          #if [ ! [ "$sizezip" = "$sizearchive" ] && ! [ ${archive[1]} -eq -1 ] ] || [ ! [ "$sizezip" = "$sizefails" ] && ! [ ${fails[1]} -eq -1 ] ]
    469411         if [  "$sizezip" != "$sizearchive"  -a  ${archive[1]} -ne -1 ] || [  "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1  ]
    470412         then
    471             #echo "  --"$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    472             #if
    473             #then
    474                echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    475                archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
    476             #else
    477             #   archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
    478             #fi
     413            echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
     414            archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
    479415         else
    480416            archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
     
    491427     
    492428      result=$result"-"
    493       #echo "Wue:  ok: "$wueokcounter" diff: "$wuediffcounter
    494       #echo "Arch: ok: "$archiveokcounter" diff: "$archivediffcounter
    495429      # raw files
    496       echo "INFO "$dataokcounter" files are ok on data (raw)."
    497       echo "WARN "$datadiffcounter" files have a different size on data (raw)."
    498430      if [ $dataokcounter -eq ${data[0]} ]
    499431      then
     
    506438      # zipped files
    507439      # dl00
     440      if [ $dl00okcounter -eq ${dl00[0]} ]
     441      then
     442         result=$result"0"
     443         numok=`echo " $numok + 1 " | bc -l `
     444      else
     445         result=$result"1"
     446         numpb=`echo " $numpb + 1 " | bc -l `
     447      fi
     448      # archive
     449      if [ $archiveokcounter -eq ${daq[0]} ]
     450      then
     451         result=$result"0"
     452         numok=`echo " $numok + 1 " | bc -l `
     453      else
     454         result=$result"1"
     455         numpb=`echo " $numpb + 1 " | bc -l `
     456      fi
     457      # wue
     458      if [ $wueokcounter -eq ${wue[0]} ]
     459      then
     460         result=$result"0"
     461         numok=`echo " $numok + 1 " | bc -l `
     462      else
     463         result=$result"1"
     464         numpb=`echo " $numpb + 1 " | bc -l `
     465      fi
     466      echo "INFO "$dataokcounter" files are ok on data (raw)."
    508467      echo "INFO "$dl00okcounter" files are ok on dl00."
     468      echo "INFO "$wueokcounter" files are ok in Wue."
     469      echo "INFO "$archiveokcounter" files are ok in the archive."
     470      echo "WARN "$datadiffcounter" files have a different size on data (raw)."
    509471      echo "WARN "$dl00diffcounter" files have a different size on dl00."
    510       if [ $dl00okcounter -eq ${dl00[0]} ]
    511       then
    512          result=$result"0"
    513          numok=`echo " $numok + 1 " | bc -l `
    514       else
    515          result=$result"1"
    516          numpb=`echo " $numpb + 1 " | bc -l `
    517       fi
    518       # archive
    519       echo "INFO "$archiveokcounter" files are ok in the archive."
     472      echo "WARN "$wuediffcounter" files have a different size in Wue."
    520473      echo "WARN "$archivediffcounter" files have a different size in the archive."
    521       if [ $archiveokcounter -eq ${daq[0]} ]
    522       then
    523          result=$result"0"
    524          numok=`echo " $numok + 1 " | bc -l `
    525       else
    526          result=$result"1"
    527          numpb=`echo " $numpb + 1 " | bc -l `
    528       fi
    529       # wue
    530       echo "INFO "$wueokcounter" files are ok in Wue."
    531       echo "WARN "$wuediffcounter" files have a different size in Wue."
    532       if [ $wueokcounter -eq ${wue[0]} ]
    533       then
    534          result=$result"0"
    535          numok=`echo " $numok + 1 " | bc -l `
    536       else
    537          result=$result"1"
    538          numpb=`echo " $numpb + 1 " | bc -l `
    539       fi
    540    fi
    541    
    542    # list #drs
     474   fi
    543475   
    544476   # print summary:
     
    553485   sumdata=`echo " $sumdata + $sumdatanew " | bc -l `
    554486   echo "checked alread "$sumdata" GB."$sumdatanew" "${data[1]}" "${zip[1]}
    555    #if [ $numpb -eq 0 ]
    556487   if [ $numpb -lt 4 ]
    557488   then
Note: See TracChangeset for help on using the changeset viewer.