Index: trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 9113)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 9114)
@@ -62,4 +62,5 @@
 
 date | tee ${checkpath}/tape_${id}.md5.lapalma | tee ${checkpath}/tape_${id}.md5.wue
+muxslog=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw $file | wc -l`
 
 # read the tapecont file line by line
@@ -67,7 +68,7 @@
 do
    muxchk=`echo $line | cut -d/ -f1`
-   type=`echo $line | cut -d_ -f7 | cut -c0-5`
+   type=`echo $line | sed -e 's/.*20[01][0-9]\{5\}_.*\(.raw\)/\1/' | cut -c 0-4`
    # only check muxdata rawfiles, not cc-, caco- or drivelog-files
-   if [ "$muxchk" = "muxdata" ] && [ "$type" = "E.raw" ]
+   if [ "$muxchk" = "muxdata" ] && [ "$type" = ".raw" ]
    then
       sum=($line)
@@ -103,5 +104,4 @@
 echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now."
 
-
 # check for differences in the checksums
 output=`diff ${checkpath}/tape_${id}.md5.lapalma ${checkpath}/tape_${id}.md5.wue`
@@ -109,5 +109,12 @@
 if [ "$output" = "" ]
 then
-   echo "All checksums are ok! Launching movingrawfiles now."# to be included
+   echo "All checksums are identical!"
+   muxschk=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw ${checkpath}/tape_${id}.md5.wue | wc -l`
+   if [ $muxslog == $muxschk ]
+   then
+      echo "Number of checked files matches. Launching movingrawfiles now. (to be included)" | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
+   else
+      echo "Number of checked files doesn't match number of extracted files. Something went wrong..." | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
+   fi
 else
    echo -e "The files are not identical! diff found the following differences:\n$output"
Index: trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto	(revision 9113)
+++ trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto	(revision 9114)
@@ -38,5 +38,5 @@
 
 echo "do rsync for callisto files" >> $scriptlog 2>&1
-rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1
+rsync -av --delete --exclude=*/*/20[01][0-9]*_Y_*[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1
 
 echo "do rsync for subsystem files" >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star	(revision 9113)
+++ trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star	(revision 9114)
@@ -38,8 +38,8 @@
 
 echo "do rsync for star files" >> $scriptlog 2>&1
-rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1
+rsync -avn --delete --exclude=*/*/20[01][0-9]*_I_*[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1
 
 echo "do rsync for star files from la palma" >> $scriptlog 2>&1
-rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1
+rsync -avn --delete --exclude=*/20[01][0-9]*_I_*[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1
 
 echo "do rsync for sequence files" >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/zipscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/zipscript	(revision 9113)
+++ trunk/MagicSoft/Mars/datacenter/scripts/zipscript	(revision 9114)
@@ -19,4 +19,5 @@
 #
 #   Author(s): Daniela Dorner  09/2006 <mailto:dorner@astro.uni-wuerzburg.de>
+#   Author(s): Stefan Ruegamer 08/2008 <mailto:snruegam@astro.uni-wuerzburg.de>
 #
 #   Copyright: MAGIC Software Development, 2000-2007
@@ -55,5 +56,10 @@
 for file in ${files[@]}
 do
-   echo "processing file $file..." >> $scriptlog 2>&1 
+   if ! [ -f $file ]
+   then
+      continue
+   fi
+   
+   echo -e "\nprocessing file $file..." >> $scriptlog 2>&1 
    runno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\2/'`
    fileno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\3/'`
@@ -69,29 +75,37 @@
       telno=1
    fi
+   
+   # get the sequence corresponding to the run
    query="SELECT fSequenceFirst FROM RunData WHERE fRunNumber="$runno" AND fFileNumber="$fileno" AND fTelescopeNumber="$telno
-   echo " sending query: $query" >> $scriptlog 2>&1 
+   echo " sending query: $query" >> $scriptlog 2>&1
    if ! seq=`sendquery`
    then
-      echo "querying seq for run M_${telno}${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&1
-      printprocesslog "WARN query $seq for run M_${telno}${runno}.${fileno} from the db did not work"
+      echo "querying seq for run M${telno}_${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&1
+      printprocesslog "WARN query $seq for run M${telno}_${runno}.${fileno} from the db did not work"
       continue
    fi
-   if [ "$seq" == "" ] 
+   if [ "$seq" == "" ] || [ "$seq" == "0" ]
    then
-      echo "no seq found for run M_${telno}${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&1
-      seq=$runno
+      echo "no seq found for run M${telno}_${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&1
+      seq=${runno}.${fileno}
    fi
-   echo "locking sequence $seq..."  >> $scriptlog 2>&1 
+   
+   # lock the sequence against zipscript
+   echo "locking sequence ${seq}-${telno}..."  >> $scriptlog 2>&1
    lockfile=$lockpath/calzip${seq}-${telno}.txt
    checklock continue >> $scriptlog 2>&1
-   query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq"
-   echo " sending query: $query" >> $scriptlog 2>&1 
+   
+   # lock the run in the db
+   query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno"
+   echo " sending query: $query" >> $scriptlog 2>&1
    if ! sendquery 
    then
-      echo "locking $seq for callisto in db did not work ..." >> $scriptlog 2>&1
-      printprocesslog "WARN locking $seq for callisto in db did not work"
+      echo "locking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1
+      printprocesslog "WARN locking ${seq}-${telno} for callisto in db did not work"
       rm -v $lockfile >> $scriptlog 2>&1
       continue
    fi
+   
+   # zip the run
    echo "zipping $file ..." >> $scriptlog 2>&1
    if ssh -xn phoenix nice -n 19 gzip -1f $file >> $scriptlog 2>&1
@@ -102,11 +116,13 @@
       printprocesslog "WARN zipping $file did not work"
    fi
-   echo "unlocking sequence $seq..."  >> $scriptlog 2>&1 
-   query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq"
-   echo " sending query: $query" >> $scriptlog 2>&1 
+   
+   # unlock the sequence in the db
+   echo "unlocking sequence ${seq}-${telno}..."  >> $scriptlog 2>&1
+   query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno"
+   echo " sending query: $query" >> $scriptlog 2>&1
    if ! sendquery 
    then
-      echo "unlocking $seq for callisto in db did not work ..." >> $scriptlog 2>&1
-      printprocesslog "ERROR unlocking $seq for callisto in db did not work"
+      echo "unlocking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1
+      printprocesslog "ERROR unlocking ${seq}-${telno} for callisto in db did not work"
       rm -v $lockfile >> $scriptlog 2>&1
       continue
