Index: /trunk/DataCheck/Transfer/ZipRawData.sh
===================================================================
--- /trunk/DataCheck/Transfer/ZipRawData.sh	(revision 18871)
+++ /trunk/DataCheck/Transfer/ZipRawData.sh	(revision 18872)
@@ -1,7 +1,11 @@
 #!/bin/bash
 
-# this script has been written to run on La Palma on the machine data
+# this script has been written to run on La Palma on the machine newdata
 #   i.e. paths are only working on this machine
 
+# to use script with /data1 instead of /scratch 
+#  (e.g. when /scratch is full) 
+# export data1=yes
+# before executing the script
 source `dirname $0`/../Sourcefile.sh
 printprocesslog "INFO starting "$0
@@ -27,4 +31,10 @@
 fi
 
+rsynctempdir=/data1/rsync_tmp
+if ! [ -d $rsynctempdir ]
+then
+   mkdir $rsynctempdir
+fi
+
 # not needed anymore as ftools are not used anymore
 ## setup to use ftools
@@ -38,5 +48,11 @@
 do 
    echo "" >> $logfile 2>&1
-   rawdir=/scratch/raw/$date
+   if [ "$data1" = "yes" ]
+   then 
+      rawdir=/data1/raw/$date
+      printprocesslog "INFO using "$rawdir" as input"
+   else 
+      rawdir=/scratch/raw/$date
+   fi
    echo `date`": processing files in "$rawdir >> $logfile 2>&1
    printprocesslog "INFO processing files in "$rawdir
@@ -98,13 +114,21 @@
       fi
       
+      printprocesslog "INFO process file "$file
+      if [ "$certaindate" != "" ]
+      then
+         echo "INFO process file "$file
+      fi
       # first rsync from /scratch to /data1
-      file2=`echo $file | sed -e 's/scratch/data1/'`
-      if ! rsync -au -T $rsynctempdir $file $file2
-      then
-         printprocesslog "ERROR something went wrong with rsync of "$file
-         rm $file2
-         continue
-      fi
-      
+      if [ "$data1" != "yes" ]
+      then 
+         file2=`echo $file | sed -e 's/scratch/data1/'`
+         if ! rsync -au -T $rsynctempdir $file $file2
+         then
+            printprocesslog "ERROR something went wrong with rsync of "$file
+            rm $file2
+            continue
+         fi
+      fi
+      # copying to /data2
       iszipped=`echo $file | grep -o fz`
       if [ "$iszipped" == "fz" ]
@@ -114,7 +138,12 @@
 
          # filename for file on data
-         zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' `
-         zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'`
-         
+         if [ "$data1" = "yes" ]
+         then 
+            zipfile=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' `
+            zipfiletmp=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'`
+         else
+            zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' `
+            zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'`
+         fi
          # check if file on data already exists
          if [ -e $zipfile ]
@@ -152,6 +181,12 @@
 
          # filename for temporary and final zipfile
-         zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'`
-         zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'`
+         if [ "$data1" = "yes" ]
+         then 
+            zipfile=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'`
+            zipfiletmp=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'`
+         else
+            zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'`
+            zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'`
+         fi
          
          # check if zipped file already exists
