Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7471)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7476)
@@ -46,11 +46,7 @@
 table=SequenceBuildStatus
 column=fExclusionsDone
-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 the script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -74,16 +68,6 @@
 esac
 
-# get the todo list
-echo "getting list..." >> $scriptlog 2>&1
-check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
-
-case $check0 in 
-   1)   echo "check0=$check0 -> everything ok -> do step" >> $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
+# get todo list
+getdolist  >> $scriptlog 2>&1
 
 dates=(`cat $todofile`)
@@ -91,8 +75,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 @@
    doexclusionspath=$logpath/$program/$year2
    makedir $doexclusionspath >> $scriptlog 2>&1
+   doexclusionslog=$doexclusionspath/doexclusions-$date.log
 
    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)//'`
+   check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionslog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
@@ -124,9 +106,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
-
