Index: trunk/MagicSoft/Mars/scripts/processsequence
===================================================================
--- trunk/MagicSoft/Mars/scripts/processsequence	(revision 8231)
+++ trunk/MagicSoft/Mars/scripts/processsequence	(revision 8482)
@@ -20,5 +20,5 @@
 #   Author(s): Daniela Dorner  10/2006 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2006
+#   Copyright: MAGIC Software Development, 2000-2007
 #
 #
@@ -80,5 +80,5 @@
           echo ""
           ;;
-     [1-9]|[0-9][0-9]|1[0-1][0-9]|12[0-7])
+      [1-9]|[0-9][0-9]|1[0-1][0-9]|12[0-7])
           echo -n "ERROR@$HOSTNAME: $program returned $check - please check the logfile $logfile"
           if [ "$program" == "callisto" ]
@@ -229,7 +229,11 @@
       mkdir -pv $merpplogpath
 
+      date=`date --date \`basename $calfile | cut -d_ -f1 +%Y/%m/%d\``
+      ccpath=$subsystempath/cc/$date
+      cacopath=$subsystempath/caco/$date
       runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
-      ccfile=`find /magic/subsystemdata/cc/ -name 20[0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep`
-      cacofile=`find /magic/subsystemdata/caco/ -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_*.txt`
+      ccfile=`find $ccpath -name 20[0-2][0-9][01][0-9][0-3][0-9]_*${runno}_[PDCS]_*_S.rep`
+      source=`echo $ccfile | cut -d_ -f4`
+      cacofile=`find /magic/subsystemdata/caco/$date -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_${source}.txt`
       echo "runno: "$runno
       echo "ccfile: "$ccfile
@@ -247,9 +251,5 @@
          do
             newrun=`echo $runno - $i | bc`
-     #      echo "$missingcacorun + $i = $newrun"
-            path=`dirname $ccfile`
-            path=`echo $path | sed -e 's/cc/caco/'`
-            echo "path: "$path
-            cacofile=`find $path -name *$newrun*`
+            cacofile=`find $cacopath -name *$newrun*`
             if [ "$cacofile" = "" ]
             then
