Ignore:
Timestamp:
03/17/14 12:40:04 (11 years ago)
Author:
Daniela Dorner
Message:
improved logging, re-enabled check if script is already running
File:
1 edited

Legend:

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

    r17616 r17618  
    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
    16 
     9numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
     10if [ $numchecktransfer -gt 1 ]
     11then
     12   printprocesslog "INFO "$0" already running -> exit. "
     13   echo "INFO "$0" already running -> exit. "
     14   finish
     15fi
    1716
    1817logfile2=$logpath"/transfer/CheckTransfer.log"
     
    2322if [ ${diskusage[3]} -lt 700000 ]
    2423then
    25    printprocesslog "DISK less than 700 GB left on /daq "
    26    echo "WARN less than 700 GB left on /daq "
    27    echo "WARN less than 700 GB left on /daq " >> $logfile2 2>&1
     24   printprocesslog "DISK less than 700 GB left on /daq ("${diskusage[3]}")"
     25   echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")"
     26   echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")" >> $logfile2 2>&1
    2827   sendemail="yes"
    2928fi
     
    3332if [ ${diskusage2[3]} -lt 500000 ]
    3433then
    35    printprocesslog "DISK less than 500 GB left on /scratch "
    36    echo "WARN less than 500 GB left on /scratch "
    37    echo "WARN less than 500 GB left on /scratch " >> $logfile2 2>&1
     34   printprocesslog "DISK less than 500 GB left on /scratch ("${diskusage2[3]}")"
     35   echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")"
     36   echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")" >> $logfile2 2>&1
    3837   sendemail="yes"
    3938fi
     
    8382check_runs_in_db "RawFileAvailISDCStatus"
    8483
    85 
    8684# get nights from directory in LP
    8785dates=( `ssh fact@161.72.93.131 "find /loc_data/zipraw -mindepth 3 -type d | sort | sed -e 's/\/loc_data\/zipraw\///g' "` )
     
    9492do
    9593   logfile=$logpath"/transfer/CheckTransfer_"`echo $date | sed -e 's/\//-/g'`".log"
     94   if grep "EVERYTHING" $logfile >/dev/null
     95   then
     96      echo $date" has been checked already and is fine."
     97      echo $date" has been checked already and is fine." >> $logfile2 2>&1
     98      continue
     99   fi
    96100   #echo ""
    97101   #echo ""
     
    100104   #echo "" >> $logfile 2>&1
    101105   #echo "" >> $logfile 2>&1
    102    echo $date > $logfile 2>&1
    103    echo $date >> $logfile2 2>&1
     106   echo "Processing "$date" ..."
     107   echo "Processing "$date" ..." > $logfile 2>&1
     108   echo "Processing "$date" ..." >> $logfile2 2>&1
    104109   if [ "$certaindate" != "" ]
    105110   then
     
    113118      then
    114119         printprocesslog "INFO continue, as certaindate has been set to "$certaindate
     120         echo " continue, as certaindate has been set to "$certaindate
    115121         continue
    116122      fi
     
    350356      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) "${qla[@]}" (qla) "$numdatruns" (datruns) "
    351357      echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile
    352       echo "" >> $logfile 2>&1
     358      echo ""
    353359      echo "SUMMARY for "$date >> $logfile 2>&1
    354360      echo "-----------------------" >> $logfile 2>&1
    355361      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) "${qla[@]}" (qla) "$numdatruns" (datruns) " >> $logfile 2>&1
    356362      echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile 2>&1
    357       echo "" >> $logfile2 2>&1
     363      echo "" >> $logfile 2>&1
    358364      echo "SUMMARY for "$date >> $logfile2 2>&1
    359365      echo "-----------------------" >> $logfile2 2>&1
    360366      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) "${qla[@]}" (qla) "$numdatruns" (datruns) " >> $logfile2 2>&1
    361367      echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile2 2>&1
     368      echo "" >> $logfile2 2>&1
    362369      #echo "number of files does not yet agree in all sites ("$result1") -> do no further checking. "
    363370      #echo "disk: "
     
    842849   fi
    843850
    844    echo ""
    845851   echo "SUMMARY for "$date
    846852   echo "-----------------------"
    847    echo "" >> $logfile 2>&1
    848853   echo "SUMMARY for "$date >> $logfile 2>&1
    849854   echo "-----------------------" >> $logfile 2>&1
    850    echo "" >> $logfile2 2>&1
    851855   echo "SUMMARY for "$date >> $logfile2 2>&1
    852856   echo "-----------------------" >> $logfile2 2>&1
     
    917921      echo "WARN not all data runs are processed yet by the QLA. " >> $logfile2 2>&1
    918922   fi
     923   echo ""
     924   echo "" >> $logfile 2>&1
     925   echo "" >> $logfile2 2>&1
    919926done
    920927
Note: See TracChangeset for help on using the changeset viewer.