Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 9054)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 9355)
@@ -43,13 +43,10 @@
 set -C
 
-scriptlog=$runlogpath/$program-$datetime.log
-date >> $scriptlog 2>&1
-
 # check if the script is already running
 lockfile=$lockpath/lock-$program.txt
-checklock  >> $scriptlog 2>&1
+checklock 
 
 # get todo file
-gettodo  >> $scriptlog 2>&1
+gettodo 
 
 cd $mars
@@ -67,11 +64,10 @@
    calibfile=$path/calib$no2.root
    fillcallistologpath=$logpath/$program/$no
-   makedir $fillcallistologpath >> $scriptlog 2>&1
+   makedir $fillcallistologpath 
    fillcaliblog=$fillcallistologpath/fillcalib-$sequence.log
    fillsignallog=$fillcallistologpath/fillsignal-$sequence.log
 
-   echo "run $program for sequence $sequence" >> $scriptlog 2>&1
-   setstatus "start" >> $scriptlog 2>&1
-   echo "run fillcalib..." >> $scriptlog 2>&1
+   printprocesslog "INFO run $program for sequence $sequence" 
+   setstatus "start" 
    printprocesslog "INFO starting fillcalib for sequence $sequence"
 
@@ -79,17 +75,14 @@
 
    case $check1 in
-      1)   echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 
-           printprocesslog "INFO done fillcalib successfully for sequence $sequence"
+      1)   printprocesslog "INFO done fillcalib successfully for sequence $sequence (check1=$check1)"
            ;;
-      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 
-           printprocesslog "WARN connection to DB failed"
+      0)   printprocesslog "WARN connection to DB failed (check1=$check1)"
            check="no"
-           setstatus "stop" >> $scriptlog 2>&1
+           setstatus "stop" 
            continue ;;
-      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           printprocesslog "ERROR fillcalib failed for sequence $sequence"
+      *)   printprocesslog "ERROR fillcalib failed for sequence $sequence (check1=$check1)"
            com=$Ffillcalib
            check=$check1
-           setstatus "stop" >> $scriptlog 2>&1
+           setstatus "stop" 
            continue ;;
    esac
@@ -98,13 +91,10 @@
    check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | intgrep`
    case $check2 in
-      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
-           printprocesslog "INFO done fillsignal successfully for sequence $sequence"
+      1)   printprocesslog "INFO done fillsignal successfully for sequence $sequence (check2=$check2)"
            ;;
-      0)   echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 
-           printprocesslog "WARN connection to DB failed"
+      0)   printprocesslog "WARN connection to DB failed (check2=$check2)"
            check="no"
            ;;
-      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           printprocesslog "ERROR fillsignal failed for sequence $sequence"
+      *)   printprocesslog "ERROR fillsignal failed for sequence $sequence (check2=$check2)"
            com=$Ffillsignal
            check=$check2
@@ -112,7 +102,7 @@
    esac
    
-   setstatus "stop" >> $scriptlog 2>&1
+   setstatus "stop" 
 done
 
-finish >> $scriptlog 2>&1
+finish 
 
