Index: trunk/DataCheck/Transfer/CheckTransfer.sh
===================================================================
--- trunk/DataCheck/Transfer/CheckTransfer.sh	(revision 17612)
+++ trunk/DataCheck/Transfer/CheckTransfer.sh	(revision 17616)
@@ -7,11 +7,12 @@
 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"
@@ -22,5 +23,5 @@
 if [ ${diskusage[3]} -lt 700000 ] 
 then
-   printprocesslog "WARN less than 700 GB left on /daq "
+   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
@@ -32,5 +33,5 @@
 if [ ${diskusage2[3]} -lt 500000 ] 
 then
-   printprocesslog "WARN less than 500 GB left on /scratch "
+   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
@@ -83,16 +84,6 @@
 
 
-# get last 10 nights (skip current night)
-dates=( `date +%Y/%m/%d --date="-360hour"` `date +%Y/%m/%d --date="-336hour"` `date +%Y/%m/%d --date="-312hour"` \ 
-        `date +%Y/%m/%d --date="-288hour"` `date +%Y/%m/%d --date="-264hour"` `date +%Y/%m/%d --date="-240hour"` \ 
-        `date +%Y/%m/%d --date="-216hour"` `date +%Y/%m/%d --date="-192hour"` `date +%Y/%m/%d --date="-168hour"` \ 
-        `date +%Y/%m/%d --date="-144hour"` `date +%Y/%m/%d --date="-120hour"` `date +%Y/%m/%d --date="-96hour"` \
-        `date +%Y/%m/%d --date="-72hour"` `date +%Y/%m/%d --date="-48hour"` `date +%Y/%m/%d --date="-24hour"` \
-        )
 # 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' "` )
-
-#dates=( "2013/08/02" )
-#short="yes"
 
 numdaysok=0
@@ -106,9 +97,23 @@
    #echo ""
    #echo ""
-   #echo $date
    #echo "" > $logfile 2>&1
    #echo "" >> $logfile 2>&1
    #echo "" >> $logfile 2>&1
    echo $date > $logfile 2>&1
+   echo $date >> $logfile2 2>&1
+   if [ "$certaindate" != "" ]
+   then
+      checkstring=`echo $certaindate | grep -E -o '20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]'`
+      if [ "$checkstring" = "" ]
+      then
+         echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
+         finish
+      fi
+      if [ "$certaindate" != "$date" ]
+      then
+         printprocesslog "INFO continue, as certaindate has been set to "$certaindate
+         continue
+      fi
+   fi
 
    # some counters
@@ -331,5 +336,10 @@
    #fi
    
-   if [ "$short" = "yes" ] || [ "$result1" != "0-0000" ]
+   if [ "$result1" != "0-0000" ] && [ "$short" != "no" ]
+   then
+      short="yes"
+   fi
+   
+   if [ "$short" = "yes" ] 
    then
       printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking."
@@ -547,4 +557,5 @@
          #rawfile2=$rawfile".gz"
          rawfile2=$rawfile".*z"
+         printprocesslog "INFO checking "$rawfile
          
          # get file sizes for run
@@ -578,5 +589,5 @@
          if ! [ "$sizenewdaq" = "$sizedaq" ]
          then
-            printprocesslog "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
+            printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
             echo "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
             daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
@@ -587,5 +598,5 @@
          if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") dl00("$sizedl00")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
             echo "  "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
             dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
@@ -598,5 +609,5 @@
          if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ] 
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
             echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
             #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]}
@@ -608,5 +619,5 @@
          if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") wue("$sizewue")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
             echo "  "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
             wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
@@ -663,5 +674,5 @@
          if ! [ "$sizenewdaq" = "$sizedaq" ]
          then
-            printprocesslog "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
+            printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
             echo "  "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
             daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
@@ -672,5 +683,5 @@
          if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") dl00("$sizedl00")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
             echo "  "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
             dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
@@ -681,5 +692,5 @@
          if [  "$sizezip" != "$sizearchive"  -a  ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [  "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ]
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
             echo "  "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
             archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
@@ -690,5 +701,5 @@
          if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
          then
-            printprocesslog "  "$rawfile2" data("$sizezip") wue("$sizewue")"
+            printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
             echo "  "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
             wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
@@ -699,5 +710,5 @@
          #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
          #then
-         #   printprocesslog "  "$rawfile2" data("$sizezip") phido("$sizephido")"
+         #   printprocesslog "WARN "$rawfile2" data("$sizezip") phido("$sizephido")"
          #   echo "  "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
          #   phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
@@ -765,9 +776,4 @@
       printprocesslog "INFO "$archiveokcounter" files are ok in the archive."
       #printprocesslog "INFO "$phidookcounter" files are ok on Phido."
-      printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
-      printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
-      printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
-      printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
-      #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
       echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1
       echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1
@@ -775,8 +781,37 @@
       echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1
       #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1
-      echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
-      echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
-      echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
-      echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
+      if [ $daqdiffcounter -gt 0 ]
+      then 
+         printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
+         echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
+      else
+         printprocesslog "INFO "$daqdiffcounter" files have a different size on daq (raw)."
+         echo "INFO "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
+      fi
+      if [ $dl00diffcounter -gt 0 ]
+      then 
+         printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
+         echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
+      else
+         printprocesslog "INFO "$dl00diffcounter" files have a different size on dl00."
+         echo "INFO "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
+      fi
+      if [ $wuediffcounter -gt 0 ]
+      then 
+         printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
+         echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
+      else
+         printprocesslog "INFO "$wuediffcounter" files have a different size in Wue."
+         echo "INFO "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
+      fi
+      if [ $archivediffcounter -gt 0 ]
+      then 
+         printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
+         echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
+      else
+         printprocesslog "INFO "$archivediffcounter" files have a different size in the archive."
+         echo "INFO "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
+      fi
+      #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
       #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1
    fi
