Index: trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 9054)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 9355)
@@ -42,13 +42,10 @@
 set -C
 
-scriptlog=$runlogpath/$program-$datetime.log
-date >> $scriptlog 2>&1
-
 # check if script is already running
 lockfile=$lockpath/lock-$program.txt
-checklock  >> $scriptlog 2>&1
+checklock 
 
 # get todo list
-gettodo  >> $scriptlog 2>&1
+gettodo 
 
 cd $mars
@@ -63,32 +60,28 @@
    no2=`printf %08d $sequence`
    sequencepath=$sequpath/$no
-   makedir $sequencepath >> $scriptlog 2>&1
+   makedir $sequencepath 
 
    writesequencefilelogpath=$logpath/$program/$no
-   makedir $writesequencefilelogpath >> $scriptlog 2>&1
+   makedir $writesequencefilelogpath 
    writesequencefilelog=$writesequencefilelogpath/writesequencefile-$no2.log
 
-   echo "write sequencefile for sequence $sequence" >> $scriptlog 2>&1
-   setstatus "start" >> $scriptlog 2>&1
+   setstatus "start" 
 
-   check2=`root -q -b $macrospath/writesequencefile.C\($sequence\,$telnum\,"\"$sequpath\""\) | tee $writesequencefilelog | intgrep`
-   case $check2 in
-      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
-           printprocesslog "INFO sequence file successfully written for sequence $sequence"
+   check1=`root -q -b $macrospath/writesequencefile.C\($sequence\,$telnum\,"\"$sequpath\""\) | tee $writesequencefilelog | intgrep`
+   case $check1 in
+      1)   printprocesslog "INFO sequence file successfully written for sequence $sequence (check1=$check1)"
            ;;
-      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 (check1=$check1)"
            check="no"
            ;;
-      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           printprocesslog "ERROR $program.C failed for sequence $sequence"
+      *)   printprocesslog "ERROR $program.C failed for sequence $sequence (check1=$check1)"
            com=$Fwritesequfile
-           check=$check2
+           check=$check1
            ;;
    esac
    
-   setstatus "stop" >> $scriptlog 2>&1
+   setstatus "stop" 
 done
 
-finish >> $scriptlog 2>&1
+finish 
 
