Index: trunk/DataCheck/QuickLook/Step1.sh
===================================================================
--- trunk/DataCheck/QuickLook/Step1.sh	(revision 17078)
+++ trunk/DataCheck/QuickLook/Step1.sh	(revision 17108)
@@ -7,6 +7,7 @@
 datepath=`date --date="-19HOUR" +%Y/%m/%d`
 date=`date --date="-19HOUR" +%Y%m%d`
-#datepath="2013/07/13"
-#date="20130713"
+# for processing by hand
+#datepath="2013/08/11"
+#date="20130811"
 printprocesslog "INFO processing "$datepath
 night=`echo $datepath | sed -e 's/\///g'`
@@ -51,7 +52,12 @@
    then 
       printprocesslog "INFO rsync "$1
-      #if ! rsync -av --stats $1 $2
-      #if ! rsync -av $1 $2
-      if ! rsync -a -T $rsynctempdir $1 $2
+      # rsync 
+      #   from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/
+      #   to daq (/daq = /loc_data on daq)
+      rsyncservernewdaq=`echo $1 | sed -e 's/^\//172.16.100.100::/'` 
+      # old
+      #if ! rsync -a -T $rsynctempdir $1 $2
+      # new (workaround for problems on daq)
+      if ! rsync -a -T $rsynctempdir $rsyncservernewdaq $2
       then 
          printprocesslog "WARN rsync of "$1" failed."
@@ -112,32 +118,46 @@
       printprocesslog "processing "$file
       localfile=`echo $file | sed -e 's/newdaq/loc_data/'`
-      #echo "processing "$file" "$localfile
-
-      if [ "`echo $file | grep -o drs`" == "drs" ]
-      then
-         nondrsfile=`echo $file | sed -e 's/[.]drs//g'`
-         tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
-      else
-         tstop=`$factpath/fitsdump -h $file  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
-      fi
-      if [ "$tstop" == "0" ]
-      then
-         printprocesslog "WARN "$file" not yet closed."
-         fileaccessed=`find $file -amin -30`
-         if ! [ "$fileaccessed" == "" ]
-         then
-            printprocesslog "INFO "$file" was accessed in the last 30 minutes => continue"
-            continue
-         else
-            printprocesslog "WARN: "$file" has empty TSTOP but was not touched for 30 minutes"
-            fileerror="yes"
-         fi
-      fi
 
       source `dirname $0`/../Sourcefile.sh
+      # check if file is already transferred
       if ! ls $localfile >/dev/null 2>&1 
       then
-         #if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
-         if ! rsync -a -T $rsynctempdir --bwlimit=$bwlimit $file $localfile
+         # check if it is drs-file
+         #   get stop time from raw-file
+         if [ "`echo $file | grep -o drs`" == "drs" ]
+         then
+            nondrsfile=`echo $file | sed -e 's/[.]drs//g'`
+            tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
+         else
+            tstop=`$factpath/fitsdump -h $file  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
+         fi
+         # when stop time is 0, file is not closed
+         if [ "$tstop" == "0" ]
+         then
+            printprocesslog "WARN "$file" not yet closed."
+            # if a file is not closed and not touched for 30 minutes, 
+            #    it is assumed corrupted and still transferred
+            fileaccessed=`find $file -amin -30`
+            if ! [ "$fileaccessed" == "" ]
+            then
+               printprocesslog "INFO "$file" was accessed in the last 30 minutes => continue"
+               continue
+            else
+               printprocesslog "WARN: "$file" has empty TSTOP but was not touched for 30 minutes"
+               fileerror="yes"
+            fi
+         fi
+
+         # rsync 
+         #   from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/
+         #   to daq (/daq = /loc_data on daq)
+         # to access rsync server via the dedicated network between 
+         #    daq and newdaq, use 172.16.100.100::newdaq
+         filersyncserver=`echo $file | sed -e 's/^\//172.16.100.100::/'` 
+         # old
+         ##if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
+         #if ! rsync -a -T $rsynctempdir --bwlimit=$bwlimit $file $localfile
+         # new
+         if ! rsync -a -W -T $rsynctempdir --bwlimit=$bwlimit $filersyncserver $localfile
          then
             printprocesslog "ERROR something went wrong with rsync of "$file
