Index: trunk/DataCheck/ZipRawData.sh
===================================================================
--- trunk/DataCheck/ZipRawData.sh	(revision 12750)
+++ trunk/DataCheck/ZipRawData.sh	(revision 12760)
@@ -6,4 +6,11 @@
 # get last 3 nights
 dates=( `date +%Y/%m/%d` `date +%Y/%m/%d --date="-1day"` `date +%Y/%m/%d --date="-2day"` `date +%Y/%m/%d --date="-3day"` )
+
+# time rawfile is untouched before further processing (i.e. adding checksum and zipping)
+delaytime=30 #30 minutes
+
+# setup to use ftools
+export HEADAS=/opt/heasoft-6.11/x86_64-unknown-linux-gnu-libc2.13-0/
+source $HEADAS/headas-init.sh
 
 # do rsync for rawfiles of these dates
@@ -51,9 +58,9 @@
       fi
 
-      # check if raw file was accessed in the last 30 minutes
-      isnew=`find $file -amin -30`
+      # check if raw file was accessed in the last $delaytime minutes
+      isnew=`find $file -amin -$delaytime`
       if [ "$isnew" != "" ]
       then
-         echo $file" is not older than 30 min => continue" >> $logfile 2>&1
+         echo $file" is not older than $delaytime min => continue" >> $logfile 2>&1
          continue
       fi
@@ -79,4 +86,16 @@
       fi
 
+#      # update the raw file with the checksums
+#      ftchecksum update=yes $file >> $logfile 2>&1
+#      check=$?
+#      if [ $check -eq 0 ]
+#      then
+#         echo `date`": file "$file" was updated with the checksums " >> $logfile 2>&1
+#      else
+#         echo `date`": problem when updating file "$file" (ftchecksum exited with "$check")" >> $logfile 2>&1
+#         echo `date`": problem when updating file "$file" (ftchecksum exited with "$check")"
+#         continue
+#      fi
+
       echo `date`": zipping "$file" to "$zipfile" ..." >> $logfile 2>&1
       # zip file to stdout and pipe it to outputfile
