Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7471)
@@ -103,21 +103,24 @@
    echo "building sequence entries for date $date..." >> $scriptlog 2>&1
    year2=`echo $date | cut -c 1-4`
+   var1=$year2
+   var2=$date
    buildsequentriespath=$logpath/$program/$year2
    makedir  $buildsequentriespath >> $scriptlog 2>&1
+
+   echo "run $program..." >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
 
    check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentriespath/buildsequenceentries-$date.log | grep int | sed -e 's/(int)//'`
 
    case $check1 in
-      1)   echo "check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1
-           statustime="Now()"
-           failed="NULL"
-           starttime="NULL"
-           failedtime="NULL"
-           var1=$year2
-           var2=$date
-           setstatus
-   	   ;;
-      *)   echo "check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1;;
+      1)   echo "check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1;;
+      *)   echo "check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1
+           com="building of sequences for date $date failed"
+           check=$check1
+           ;;
    esac
+
+   echo "inserting the status for $program for date $date into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7471)
@@ -103,4 +103,6 @@
    no=`printf %08d $sequence | cut -c 0-4`
    no2=`printf %08d $sequence`
+   var1=$no
+   var2=$no2
    outpath=$logpath/$program/$no
    echo "outpath: "$outpath  >> $scriptlog 2>&1 
@@ -109,18 +111,19 @@
    sequencefile=$sequpath/$no/sequence$no2.txt
 
+   echo "run $program..." >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $outpath/checkfileavail-$sequence.log | grep int | sed -e 's/(int)//'`
 
    case $check1 in
-      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 
-           statustime="Now()"
-           failed="NULL"
-           starttime="NULL"
-           failedtime="NULL"
-           var1=$no
-           var2=$sequence
-           setstatus
-   	   ;;
-      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
+      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
+      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+           com="checking availability of files for sequence $sequence failed"
+           check=$check1
+           ;;
    esac
+
+   echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7471)
@@ -100,4 +100,6 @@
 do 
    no=`printf %08d $dataset | cut -c 0-5`
+   var1=$no
+   var2=$dataset
    echo "checking files for dataset $dataset..." >> $scriptlog 2>&1 
    datasetfile=$datasetpath/$no/dataset`printf %08d $dataset`.txt
@@ -117,6 +119,10 @@
    makedir $outpath  >> $scriptlog 2>&1 
    
+   echo "run $program..." >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    for sequence in ${sequences[@]}
    do 
+
       check1=`root -q -b $macrospath/checkstardone.C+\(\""$sequence\""\) | tee $outpath/checkstardone-$sequence.log | grep int | sed -e 's/(int)//'`
 
@@ -125,16 +131,13 @@
          *)   echo "check1=$check1 -> ERROR " >> $scriptlog 2>&1 
               echo "starfiles not available for sequence -> continue" >> $scriptlog 2>&1 
-              continue 2
+              com="starfile missing for sequence $sequence"
+              check=$check1
+              break
               ;;
       esac
    done
    
-   statustime="Now()"
-   failed="NULL"
-   starttime="NULL"
-   failedtime="NULL"
-   var1=$no
-   var2=$dataset
-   setstatus
+   echo "inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/correcttime
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7471)
@@ -80,4 +80,7 @@
 for run in ${runs[@]}
 do 
+  no=`printf %08d $run | cut -c 1-5`
+  var1=$no
+  var2=$run
   echo "getting path for run $run ... "
   infile=`find $datapath/rawfiles-wrong-timing/ -name *${run}_[D,C,P,S]_*`
@@ -94,21 +97,19 @@
   
   check1=0
-  echo "run $program..."
+  echo "run $program..." >> $scriptlog 2>&1
+  setstatus "start" >> $scriptlog 2>&1
+
   /home/tape/MagicReadout/correct_raw_time $infile $outfile > $timecorrpath/$program-$run.log
   check1=$?
 
   case $check1 in
-     1)   echo "check1=$check1 -> everything ok -> setting status..."
-          no=`printf %08d $run | cut -c 1-5`
-          statustime="Now()"
-          failed="NULL"
-          starttime="NULL"
-          failedtime="NULL"
-          var1=$no
-          var2=$run
-          setstatus
-  	;;
-     *)   echo "check1=$check1 -> ERROR -> step has to be repeated";;
+     1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
+     *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
+          com="time correction for run $run failed"
+          check=$check1
+          ;;
   esac
+  echo "inserting the status for $program for run $run into the db" >> $scriptlog 2>&1
+  setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7471)
@@ -143,8 +143,9 @@
 for run in ${runs[@]}
 do 
-   date
    echo "do $program for run "$run >> $scriptlog 2>&1
    no=`printf %08d $run | cut -c 0-2`
    no2=`printf %08d $run`
+   var1=$date
+   var2=$no2
    rawfile=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw`
    echo "rawfile: "$rawfile >> $scriptlog 2>&1
@@ -161,4 +162,6 @@
 
    echo "doing filldotraw..." >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'`
 
@@ -167,5 +170,8 @@
             ;;
        *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-            continue;;
+            com="filldotraw for run $run failed"
+            check=$check1
+            setstatus "stop" >> $scriptlog 2>&1
+            continue ;;
    esac
    
@@ -189,4 +195,7 @@
                ;;
           *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+               com="sinope for run $run failed"
+               check=$check2
+               setstatus "stop" >> $scriptlog 2>&1
                continue 2;;
       esac
@@ -206,4 +215,7 @@
             ;;
        *)   echo "check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+            com="fillsinope for run $run failed"
+            check=$check3
+            setstatus "stop" >> $scriptlog 2>&1
             continue;;
    esac
@@ -222,4 +234,7 @@
            ;;
       *)   echo "check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1
+           com="reset status for fExclusionsDone for date $date2 failed"
+           check=$check5
+           setstatus "stop" >> $scriptlog 2>&1
            continue;;
    esac
Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7471)
@@ -103,21 +103,23 @@
    echo "do exclusions for date "$date >> $scriptlog 2>&1
    year2=`echo $date | cut -c 1-4`
+   var1=$year2
+   var2=$date
    doexclusionspath=$logpath/$program/$year2
    makedir $doexclusionspath >> $scriptlog 2>&1
+
+   echo "run $program..." >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
 
    check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionspath/doexclusions-$date.log | grep int | sed -e 's/(int)//'`
 
    case $check1 in
-      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1
-           statustime="Now()"
-           failed="NULL"
-           starttime="NULL"
-           failedtime="NULL"
-           var1=$year2
-           var2=$date
-           setstatus
-   	;;
+      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
+           com="doing exclusions for date $date failed"
+           check=$check1
+           ;;
    esac
+   echo "inserting the status for $program for date $date into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7471)
@@ -104,4 +104,6 @@
    no=`printf %08d $sequence | cut -c 0-4`
    no2=`printf %08d $sequence`
+   var1=$no
+   var2=$no2
    path="$datapath/callisto/$no/$no2"
    signalfile=$path/signal$no2.root
@@ -114,27 +116,28 @@
 
    echo "run $program for sequence $sequence" >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
    echo "run fillcalib..." >> $scriptlog 2>&1
+
    check1=`root -q -b $macrospath/fillcalib.C+\("\"$calibfile\""\,kFALSE\) | tee $fillcaliblog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
-      1)   echo "check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1;;
+      1)   echo "check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 ;;
       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           continue;;
+           com="fillcalib for sequence $sequence failed"
+           check=$check1
+           setstatus "stop" >> $scriptlog 2>&1
+           continue ;;
    esac
 
    check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | grep int | sed -e 's/(int)//'`
    case $check2 in
-      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1
-           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=$sequence
-           setstatus
-   	  ;;
-      *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
+      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
+      *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+           com="fillsignal for sequencec $sequence failed"
+           check=$check2
+           ;;
    esac
+   echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7471)
@@ -104,4 +104,6 @@
    no=`printf %08d $dataset | cut -c 0-5`
    no2=`printf %08d $dataset`
+   var1=$no
+   var2=$no2
    path="$datapath/ganymed/$no/$no2"
    ganymedfile=$path/ganymed$no2.root
@@ -112,18 +114,16 @@
 
    echo "run $program for dataset $dataset" >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | grep int | sed -e 's/(int)//'`
    case $check2 in
-      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1
-           echo "-> inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1
-           statustime="Now()"
-           failed="NULL"
-           starttime="NULL"
-           failedtime="NULL"
-           var1=$no
-           var2=$no2
-           setstatus
-   	  ;;
-      *)  echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
+      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
+      *)  echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+          com="fillganymed for dataset $dataset failed"
+          check=$check2
+          ;;
    esac
+   echo "inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7471)
@@ -104,4 +104,6 @@
    no=`printf %08d $sequence | cut -c 0-4`
    no2=`printf %08d $sequence`
+   var1=$no
+   var2=$no2
    path="$datapath/star/$no/$no2"
    starfile=$path/star$no2.root
@@ -112,18 +114,16 @@
 
    echo "run $program for sequence $sequence" >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | grep int | sed -e 's/(int)//'`
    case $check2 in
-      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1
-           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
-   	  ;;
+      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
+           com="fillstar for sequence $sequence failed"
+           check=$check2
+           ;;
    esac
+   echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7471)
@@ -79,5 +79,4 @@
    echo " failedtime=$failedtime"
    echo "-- check: -$check-"
-   ech
    echo ""
 }
Index: trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7470)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7471)
@@ -104,4 +104,6 @@
    no=`printf %08d $sequence | cut -c 0-4`
    no2=`printf %08d $sequence`
+   var1=$no
+   var2=$no2
    sequencepath=$sequpath/$no
    makedir $sequencepath >> $scriptlog 2>&1
@@ -112,18 +114,16 @@
 
    echo "write sequencefile for sequence $sequence" >> $scriptlog 2>&1
+   setstatus "start" >> $scriptlog 2>&1
+
    check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelogpath/writesequencefile-$no2.log | grep int | sed -e 's/(int)//'`
    case $check2 in
-      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1
-           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
-   	  ;;
+      1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
+           com="writing of sequencefile for sequence $sequence failed"
+           check=$check2
+           ;;
    esac
+   echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
