Index: trunk/MagicSoft/Mars/datacenter/scripts/writedatasetfiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writedatasetfiles	(revision 9113)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writedatasetfiles	(revision 9355)
@@ -41,13 +41,10 @@
 column=fDataSetFileWritten
 
-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
@@ -56,28 +53,24 @@
 do
    dataset=${primaries[$s]}
-   echo "writing dataset file for dataset $dataset..." >> $scriptlog 2>&1 
    printprocesslog "INFO writing datasetfile for dataset $dataset"
    no=`printf %08d $dataset | cut -c 0-5`
    no2=`printf %08d $dataset`
    datasetpathcpl=$datasetpath/$no
-   makedir $datasetpathcpl >> $scriptlog 2>&1 
+   makedir $datasetpathcpl 
    writedatasetfilelogpath=$logpath/$program/$no
-   makedir $writedatasetfilelogpath >> $scriptlog 2>&1 
+   makedir $writedatasetfilelogpath 
    logfile=$writedatasetfilelogpath/$program-$no2.log
 
-   setstatus "start" >> $scriptlog 2>&1
+   setstatus "start" 
    
    check1=`root -q -b $macrospath/writedatasetfile.C+\($dataset\,\""$datasetpathcpl\""\) | tee $logfile | intgrep`
 
    case $check1 in
-      1)   echo " check1=$check1 -> everything ok" >> $scriptlog 2>&1 
-           printprocesslog "INFO wrote datasetfile for dataset $dataset successfully"
+      1)   printprocesslog "INFO wrote datasetfile for dataset $dataset successfully (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"
            ;;
-      *)   echo " check1=$check1 -> ERROR " >> $scriptlog 2>&1 
-           printprocesslog "ERROR writedatasetfile.C failed"
+      *)   printprocesslog "ERROR writedatasetfile.C failed (check1=$check1)"
            com=$Fwritedatasetfile
            check=$check1
@@ -85,7 +78,7 @@
    esac
    
-   setstatus "stop" >> $scriptlog 2>&1
+   setstatus "stop" 
 done
 
-finish >> $scriptlog 2>&1
+finish 
 
