Index: trunk/DataCheck/Transfer/CheckTransfer.sh
===================================================================
--- trunk/DataCheck/Transfer/CheckTransfer.sh	(revision 17617)
+++ trunk/DataCheck/Transfer/CheckTransfer.sh	(revision 17618)
@@ -7,12 +7,11 @@
 printprocesslog "INFO starting $0"
 
-#numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
-#if [ $numchecktransfer -gt 1 ]
-#then
-#   printprocesslog "INFO "$0" already running -> exit. "
-#   echo "INFO "$0" already running -> exit. "
-#   finish
-#fi
-
+numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
+if [ $numchecktransfer -gt 1 ]
+then
+   printprocesslog "INFO "$0" already running -> exit. "
+   echo "INFO "$0" already running -> exit. "
+   finish
+fi
 
 logfile2=$logpath"/transfer/CheckTransfer.log"
@@ -23,7 +22,7 @@
 if [ ${diskusage[3]} -lt 700000 ] 
 then
-   printprocesslog "DISK less than 700 GB left on /daq "
-   echo "WARN less than 700 GB left on /daq "
-   echo "WARN less than 700 GB left on /daq " >> $logfile2 2>&1
+   printprocesslog "DISK less than 700 GB left on /daq ("${diskusage[3]}")"
+   echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")"
+   echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")" >> $logfile2 2>&1
    sendemail="yes"
 fi
@@ -33,7 +32,7 @@
 if [ ${diskusage2[3]} -lt 500000 ] 
 then
-   printprocesslog "DISK less than 500 GB left on /scratch "
-   echo "WARN less than 500 GB left on /scratch "
-   echo "WARN less than 500 GB left on /scratch " >> $logfile2 2>&1
+   printprocesslog "DISK less than 500 GB left on /scratch ("${diskusage2[3]}")"
+   echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")"
+   echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")" >> $logfile2 2>&1
    sendemail="yes"
 fi
@@ -83,5 +82,4 @@
 check_runs_in_db "RawFileAvailISDCStatus"
 
-
 # get nights from directory in LP
 dates=( `ssh fact@161.72.93.131 "find /loc_data/zipraw -mindepth 3 -type d | sort | sed -e 's/\/loc_data\/zipraw\///g' "` )
@@ -94,4 +92,10 @@
 do 
    logfile=$logpath"/transfer/CheckTransfer_"`echo $date | sed -e 's/\//-/g'`".log"
+   if grep "EVERYTHING" $logfile >/dev/null
+   then
+      echo $date" has been checked already and is fine."
+      echo $date" has been checked already and is fine." >> $logfile2 2>&1
+      continue
+   fi
    #echo ""
    #echo ""
@@ -100,6 +104,7 @@
    #echo "" >> $logfile 2>&1
    #echo "" >> $logfile 2>&1
-   echo $date > $logfile 2>&1
-   echo $date >> $logfile2 2>&1
+   echo "Processing "$date" ..." 
+   echo "Processing "$date" ..." > $logfile 2>&1
+   echo "Processing "$date" ..." >> $logfile2 2>&1
    if [ "$certaindate" != "" ]
    then
@@ -113,4 +118,5 @@
       then
          printprocesslog "INFO continue, as certaindate has been set to "$certaindate
+         echo " continue, as certaindate has been set to "$certaindate
          continue
       fi
@@ -350,14 +356,15 @@
       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) "
       echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile
-      echo "" >> $logfile 2>&1
+      echo "" 
       echo "SUMMARY for "$date >> $logfile 2>&1
       echo "-----------------------" >> $logfile 2>&1
       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
       echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile 2>&1
-      echo "" >> $logfile2 2>&1
+      echo "" >> $logfile 2>&1
       echo "SUMMARY for "$date >> $logfile2 2>&1
       echo "-----------------------" >> $logfile2 2>&1
       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
       echo "  "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile2 2>&1
+      echo "" >> $logfile2 2>&1
       #echo "number of files does not yet agree in all sites ("$result1") -> do no further checking. "
       #echo "disk: "
@@ -842,11 +849,8 @@
    fi
 
-   echo ""
    echo "SUMMARY for "$date
    echo "-----------------------"
-   echo "" >> $logfile 2>&1
    echo "SUMMARY for "$date >> $logfile 2>&1
    echo "-----------------------" >> $logfile 2>&1
-   echo "" >> $logfile2 2>&1
    echo "SUMMARY for "$date >> $logfile2 2>&1
    echo "-----------------------" >> $logfile2 2>&1
@@ -917,4 +921,7 @@
       echo "WARN not all data runs are processed yet by the QLA. " >> $logfile2 2>&1
    fi
+   echo ""
+   echo "" >> $logfile 2>&1
+   echo "" >> $logfile2 2>&1
 done
 
