Index: trunk/DataCheck/QuickLook/Step1.sh
===================================================================
--- trunk/DataCheck/QuickLook/Step1.sh	(revision 15519)
+++ trunk/DataCheck/QuickLook/Step1.sh	(revision 15520)
@@ -48,14 +48,27 @@
 function rsync_aux_file()
 {
-   if ls $1
+   if ls $1 >/dev/null 2>&1
    then 
       printprocesslog "INFO rsync "$1
       #if ! rsync -av --stats $1 $2
-      if ! rsync -av $1 $2
+      #if ! rsync -av $1 $2
+      if ! rsync -a $1 $2
       then 
          printprocesslog "WARN rsync of "$1" failed."
       fi
+   else
+      printprocesslog "WARN "$1" missing."
    fi
 }
+
+diskusage=( `df -P /raid10 | grep raid10 ` )
+# check if more than 700 GB are left on /loc_data
+if [ ${diskusage[3]} -lt 800000000 ] 
+then
+   echo "WARN less than 700 left on /raid10 on node "$HOSTNAME
+   printprocesslog "WARN less than 700 left on /raid10 on node "$HOSTNAME
+   df -h /raid10
+   finish
+fi
 
 printprocesslog "INFO get lists of raw files on newdaq and daq"
@@ -73,5 +86,5 @@
 makedir $rawpath
 
-echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
+#echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
 printprocesslog "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
 
@@ -79,5 +92,5 @@
 do
    numdataruns=0
-   echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
+   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
    printprocesslog "INFO status beginning of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
 
@@ -89,5 +102,5 @@
       printprocesslog "processing "$file
       localfile=`echo $file | sed -e 's/newdaq/loc_data/'`
-      echo "processing "$file" "$localfile
+      #echo "processing "$file" "$localfile
 
       if [ "`echo $file | grep -o drs`" == "drs" ]
@@ -115,5 +128,6 @@
       if ! ls $localfile >/dev/null 2>&1 
       then
-         if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
+         #if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
+         if ! rsync -a --bwlimit=$bwlimit $file $localfile
          then
             printprocesslog "ERROR something went wrong with rsync of "$file
@@ -196,5 +210,5 @@
             #echo "numdata +1"
             
-            echo "cal: "$callistocount" numdat: "$numdataruns" numcallog: "${#callistofiles[@]}
+            #echo "cal: "$callistocount" numdat: "$numdataruns" numcallog: "${#callistofiles[@]}
             printprocesslog "INFO running callistos: "$callistocount" #data-runs: "$numdataruns" #callisto-logs: "${#callistofiles[@]}
             # do not overload system in case of a lot of files to be processed
@@ -203,5 +217,5 @@
             then
                printprocesslog "INFO "$callistocount" RunCallisto.sh are running -> continue"
-               echo "INFO "$callistocount" RunCallisto.sh are running -> continue"
+               #echo "INFO "$callistocount" RunCallisto.sh are running -> continue"
                continue
             fi
@@ -218,5 +232,5 @@
                #`dirname $0`/RunCallisto.sh $sourcekey $seqfile &
                printprocesslog "INFO starting RunCallisto.sh for "$seqfile
-               echo "INFO starting RunCallisto.sh for "$seqfile
+               #echo "INFO starting RunCallisto.sh for "$seqfile
                `dirname $0`/RunCallisto.sh $seqfile &
             fi
@@ -236,5 +250,5 @@
          runrow=$runrow$runnum$runtype$roi"_"
          echo $runrow > $infopath/runrow.txt
-         if echo $runrow | grep -E '[0-9]{3}drs-pedestal1024_[0-9]{3}drs-gain1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-time1024_[0-9]{3}pedestal300_[0-9]{3}pedestal300_'
+         if echo $runrow | grep -E '[0-9]{3}drs-pedestal1024_[0-9]{3}drs-gain1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-time1024_[0-9]{3}pedestal300_[0-9]{3}pedestal300_' >/dev/null
          then
             runrow2=`echo $runrow | grep -E -o '[0-9]{3}drs-pedestal1024_[0-9]{3}drs-gain1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-pedestal1024_[0-9]{3}drs-time1024_[0-9]{3}pedestal300_[0-9]{3}pedestal300_'`
@@ -265,5 +279,5 @@
             drsfile=$run6
          fi
-         if echo $runrow | grep -E '[0-9]{3}pedestal300_[0-9]{3}light-pulser-ext300_'
+         if echo $runrow | grep -E '[0-9]{3}pedestal300_[0-9]{3}light-pulser-ext300_' >/dev/null
          then
             echo "" > $infopath/runrow.txt
@@ -278,5 +292,5 @@
    fileslocal=( `find $rawpath -type f | sort` )
    callistofiles=( `find $anapath/callisto -type f -name $date*-calibration.log | sort` )
-   echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
+   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
    printprocesslog "INFO status after for-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
 
@@ -287,5 +301,5 @@
       printprocesslog "INFO wait 60 seconds."
       sleep 60
-      echo "sleep 60..."
+      #echo "sleep 60..."
       printprocesslog "INFO get new file lists for "$datepath
       files=( `find $rawpathnewdaq -type f | sort` )
@@ -293,5 +307,5 @@
       callistofiles=( `find $anapath/callisto -type f -name $date*-calibration.log | sort` )
    fi
-   echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
+   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
    printprocesslog "INFO status after wait end of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns
 done
