Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7471)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7476)
@@ -46,11 +46,7 @@
 table=SequenceBuildStatus
 column=fSequenceEntriesBuilt
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m`
@@ -60,8 +56,6 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 # check if script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -75,15 +69,5 @@
 
 # get todo list
-echo "getting todo list..." >> $scriptlog 2>&1
-check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatus.log | grep int | sed -e 's/(int)//'`
-
-case $check0 in 
-   1)   echo "check0=$check0 -> everything ok, got todo list -> build sequence entries" >> $scriptlog 2>&1;;
-   *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit" >> $scriptlog 2>&1
-	rm -v $todofile >> $scriptlog 2>&1
-	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   	date  >> $scriptlog 2>&1
-	exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 # retrieve dates from todofile
@@ -92,8 +76,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -107,9 +88,10 @@
    buildsequentriespath=$logpath/$program/$year2
    makedir  $buildsequentriespath >> $scriptlog 2>&1
+   buildsequenceentrieslog=$buildsequentriespath/buildsequenceentries-$date.log
 
    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)//'`
+   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentrieslog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
@@ -125,9 +107,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1 
-rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
