Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7460)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7465)
@@ -38,4 +38,5 @@
 
 user=`whoami`
+program=callisto
 source /home/$user/Mars/datacenter/scripts/sourcefile
 
@@ -43,6 +44,6 @@
 
 # define callisto.rc files
-callistorcnew=$setuppath/callisto/callisto.rc
-callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc
+callistorcnew=$setuppath/$program/$program.rc
+callistorcmarapr05=$setuppath/$program/$program_MarApr05.rc
 
 table=SequenceProcessStatus
@@ -54,10 +55,10 @@
 
 todofile=$listpath/ToDo-$table-$column
-getstatuslogpath=$logpath/getstatus/callisto/$year
-getstatuslog=$getstatuslogpath/getstatus-callisto-$datetime.log
-
-scriptlogpath=$logpath/run/callisto/`date +%Y/%m/%d`
+getstatuslogpath=$logpath/getstatus/$program/$year
+getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+
+scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
 makedir $scriptlogpath
-scriptlog=$scriptlogpath/runcallisto-$datetime.log
+scriptlog=$scriptlogpath/run$program-$datetime.log
 
 date >> $scriptlog 2>&1
@@ -74,10 +75,10 @@
    echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
 else
-   date > $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1 
+   date > $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1 
    checklock0=$?
    case $checklock0 in 
        0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
        1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
-            echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1
+            echo "-> getting list for $program is running -> exit" >> $scriptlog 2>&1
             date  >> $scriptlog 2>&1
             exit;;
@@ -89,11 +90,11 @@
 
    case $check0 in
-      1)   echo "check0=$check0 -> everything ok -> run callisto" >> $scriptlog 2>&1;;
+      1)   echo "check0=$check0 -> everything ok -> run $program" >> $scriptlog 2>&1;;
       *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit" >> $scriptlog 2>&1
-	   rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
+	   rm -v $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1
 	   date  >> $scriptlog 2>&1
 	   exit;;
    esac
-   rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
+   rm -v $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1
 fi
 
@@ -146,5 +147,5 @@
   no=`printf %08d $sequence | cut -c 0-4`
   no2=`printf %08d $sequence`
-  outpath="$datapath/callisto/$no/$no2"
+  outpath="$datapath/$program/$no/$no2"
   echo "outpath: "$outpath >> $scriptlog 2>&1
   makedir $outpath >> $scriptlog 2>&1
@@ -154,21 +155,21 @@
   
   # find callisto.rc file
-  if [ -e $outpath/callisto.rc ]
+  if [ -e $outpath/$program.rc ]
   then
-     echo "found callisto.rc in $outpath -> using this " >> $scriptlog 2>&1
-     callistorcseq=$outpath/callisto.rc
+     echo "found $program.rc in $outpath -> using this " >> $scriptlog 2>&1
+     callistorcseq=$outpath/$program.rc
   else
-     echo "no callisto.rc found in $outpath -> making link " >> $scriptlog 2>&1
+     echo "no $program.rc found in $outpath -> making link " >> $scriptlog 2>&1
      if [ 49735 -lt $sequence ] && [ $sequence -lt 53516 ]
      then 
-        ln -vs $callistorcmarapr05 $outpath/callisto.rc >> $scriptlog 2>&1
+        ln -vs $callistorcmarapr05 $outpath/$program.rc >> $scriptlog 2>&1
      else
-        ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
+        ln -vs $callistorcnew $outpath/$program.rc >> $scriptlog 2>&1
      fi
-     callistorcseq=$outpath/callisto.rc
+     callistorcseq=$outpath/$program.rc
   fi
 
   echo "run callisto..." >> $scriptlog 2>&1
-  ./callisto -b -q -v4 -f -raw --log=$outpath/callisto$no2.log --html=$outpath/callisto$no2.html --out=$outpath --config=$callistorcseq $sequfile  2>> $scriptlog > /dev/null
+  ./callisto -b -q -v4 -f -raw --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath --config=$callistorcseq $sequfile  2>> $scriptlog > /dev/null
   check1=$?
 
@@ -246,14 +247,12 @@
           
           # set status for calibration if merpp updates are also done
-          echo "inserting the status for callisto for sequence $sequence into the db" >> $scriptlog 2>&1
-          setstatuslogpath=$logpath/setstatus/callisto/$no
-          makedir $setstatuslogpath >> $scriptlog 2>&1
-          setstatuslog=$setstatuslogpath/setstatus-callisto-$no2.log
-
-          check4=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"Now()\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
-          case $check4 in
-  	     1)   echo "check4=$check4 -> everything ok, status has been set" >> $scriptlog 2>&1;;
-  	     *)   echo "check4=$check4 -> ERROR -> step could not be set" >> $scriptlog 2>&1;;
-          esac
+          echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+          statustime="Now()"
+          failed="NULL"
+          starttime="NULL"
+          failedtime="NULL"
+          var1=$no
+          var2=$no2
+          setstatus
   	  ;;
      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
