Ignore:
Timestamp:
03/16/14 23:47:30 (11 years ago)
Author:
Daniela Dorner
Message:
added DISK tag to logging, improved logging, added certaindate and short as environment variables
File:
1 edited

Legend:

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

    r17570 r17616  
    77printprocesslog "INFO starting $0"
    88
    9 numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
    10 if [ $numchecktransfer -gt 1 ]
    11 then
    12    printprocesslog "INFO "$0" already running -> exit. "
    13    echo "INFO "$0" already running -> exit. "
    14    finish
    15 fi
     9#numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
     10#if [ $numchecktransfer -gt 1 ]
     11#then
     12#   printprocesslog "INFO "$0" already running -> exit. "
     13#   echo "INFO "$0" already running -> exit. "
     14#   finish
     15#fi
     16
    1617
    1718logfile2=$logpath"/transfer/CheckTransfer.log"
     
    2223if [ ${diskusage[3]} -lt 700000 ]
    2324then
    24    printprocesslog "WARN less than 700 GB left on /daq "
     25   printprocesslog "DISK less than 700 GB left on /daq "
    2526   echo "WARN less than 700 GB left on /daq "
    2627   echo "WARN less than 700 GB left on /daq " >> $logfile2 2>&1
     
    3233if [ ${diskusage2[3]} -lt 500000 ]
    3334then
    34    printprocesslog "WARN less than 500 GB left on /scratch "
     35   printprocesslog "DISK less than 500 GB left on /scratch "
    3536   echo "WARN less than 500 GB left on /scratch "
    3637   echo "WARN less than 500 GB left on /scratch " >> $logfile2 2>&1
     
    8384
    8485
    85 # get last 10 nights (skip current night)
    86 dates=( `date +%Y/%m/%d --date="-360hour"` `date +%Y/%m/%d --date="-336hour"` `date +%Y/%m/%d --date="-312hour"` \
    87         `date +%Y/%m/%d --date="-288hour"` `date +%Y/%m/%d --date="-264hour"` `date +%Y/%m/%d --date="-240hour"` \
    88         `date +%Y/%m/%d --date="-216hour"` `date +%Y/%m/%d --date="-192hour"` `date +%Y/%m/%d --date="-168hour"` \
    89         `date +%Y/%m/%d --date="-144hour"` `date +%Y/%m/%d --date="-120hour"` `date +%Y/%m/%d --date="-96hour"` \
    90         `date +%Y/%m/%d --date="-72hour"` `date +%Y/%m/%d --date="-48hour"` `date +%Y/%m/%d --date="-24hour"` \
    91         )
    9286# get nights from directory in LP
    9387dates=( `ssh fact@161.72.93.131 "find /loc_data/zipraw -mindepth 3 -type d | sort | sed -e 's/\/loc_data\/zipraw\///g' "` )
    94 
    95 #dates=( "2013/08/02" )
    96 #short="yes"
    9788
    9889numdaysok=0
     
    10697   #echo ""
    10798   #echo ""
    108    #echo $date
    10999   #echo "" > $logfile 2>&1
    110100   #echo "" >> $logfile 2>&1
    111101   #echo "" >> $logfile 2>&1
    112102   echo $date > $logfile 2>&1
     103   echo $date >> $logfile2 2>&1
     104   if [ "$certaindate" != "" ]
     105   then
     106      checkstring=`echo $certaindate | grep -E -o '20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]'`
     107      if [ "$checkstring" = "" ]
     108      then
     109         echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
     110         finish
     111      fi
     112      if [ "$certaindate" != "$date" ]
     113      then
     114         printprocesslog "INFO continue, as certaindate has been set to "$certaindate
     115         continue
     116      fi
     117   fi
    113118
    114119   # some counters
     
    331336   #fi
    332337   
    333    if [ "$short" = "yes" ] || [ "$result1" != "0-0000" ]
     338   if [ "$result1" != "0-0000" ] && [ "$short" != "no" ]
     339   then
     340      short="yes"
     341   fi
     342   
     343   if [ "$short" = "yes" ]
    334344   then
    335345      printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking."
     
    547557         #rawfile2=$rawfile".gz"
    548558         rawfile2=$rawfile".*z"
     559         printprocesslog "INFO checking "$rawfile
    549560         
    550561         # get file sizes for run
     
    578589         if ! [ "$sizenewdaq" = "$sizedaq" ]
    579590         then
    580             printprocesslog "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
     591            printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
    581592            echo "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
    582593            daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
     
    587598         if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
    588599         then
    589             printprocesslog "  "$rawfile2" data("$sizezip") dl00("$sizedl00")"
     600            printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
    590601            echo "  "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
    591602            dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
     
    598609         if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ]
    599610         then
    600             printprocesslog "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
     611            printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    601612            echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
    602613            #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]}
     
    608619         if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
    609620         then
    610             printprocesslog "  "$rawfile2" data("$sizezip") wue("$sizewue")"
     621            printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
    611622            echo "  "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
    612623            wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
     
    663674         if ! [ "$sizenewdaq" = "$sizedaq" ]
    664675         then
    665             printprocesslog "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
     676            printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
    666677            echo "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
    667678            daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
     
    672683         if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
    673684         then
    674             printprocesslog "  "$rawfile2" data("$sizezip") dl00("$sizedl00")"
     685            printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
    675686            echo "  "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
    676687            dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
     
    681692         if [  "$sizezip" != "$sizearchive"  -a  ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [  "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ]
    682693         then
    683             printprocesslog "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
     694            printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
    684695            echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
    685696            archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
     
    690701         if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
    691702         then
    692             printprocesslog "  "$rawfile2" data("$sizezip") wue("$sizewue")"
     703            printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
    693704            echo "  "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
    694705            wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
     
    699710         #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
    700711         #then
    701          #   printprocesslog "  "$rawfile2" data("$sizezip") phido("$sizephido")"
     712         #   printprocesslog "WARN "$rawfile2" data("$sizezip") phido("$sizephido")"
    702713         #   echo "  "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
    703714         #   phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
     
    765776      printprocesslog "INFO "$archiveokcounter" files are ok in the archive."
    766777      #printprocesslog "INFO "$phidookcounter" files are ok on Phido."
    767       printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
    768       printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
    769       printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
    770       printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
    771       #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
    772778      echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1
    773779      echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1
     
    775781      echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1
    776782      #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1
    777       echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
    778       echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
    779       echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
    780       echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
     783      if [ $daqdiffcounter -gt 0 ]
     784      then
     785         printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
     786         echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
     787      else
     788         printprocesslog "INFO "$daqdiffcounter" files have a different size on daq (raw)."
     789         echo "INFO "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
     790      fi
     791      if [ $dl00diffcounter -gt 0 ]
     792      then
     793         printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
     794         echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
     795      else
     796         printprocesslog "INFO "$dl00diffcounter" files have a different size on dl00."
     797         echo "INFO "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
     798      fi
     799      if [ $wuediffcounter -gt 0 ]
     800      then
     801         printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
     802         echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
     803      else
     804         printprocesslog "INFO "$wuediffcounter" files have a different size in Wue."
     805         echo "INFO "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
     806      fi
     807      if [ $archivediffcounter -gt 0 ]
     808      then
     809         printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
     810         echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
     811      else
     812         printprocesslog "INFO "$archivediffcounter" files have a different size in the archive."
     813         echo "INFO "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
     814      fi
     815      #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
    781816      #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1
    782817   fi
Note: See TracChangeset for help on using the changeset viewer.