Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7460)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7465)
@@ -37,4 +37,5 @@
 
 user=`whoami`
+program=buildsequenceentries
 source /home/$user/Mars/datacenter/scripts/sourcefile
 
@@ -50,10 +51,10 @@
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/buildsequenceentries/$year
-getstatuslog=$getstatuslogpath/getstatus-buildsequenceentries-$datetime.log
+getstatuslogpath=$logpath/getstatus/$program/$year
+getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
 
-scriptlogpath=$logpath/run/buildsequenceentries/`date +%Y/%m`
+scriptlogpath=$logpath/run/$program/`date +%Y/%m`
 makedir $scriptlogpath
-scriptlog=$scriptlogpath/buildsequenceentries-$datetime.log
+scriptlog=$scriptlogpath/$program-$datetime.log
 
 date >> $scriptlog 2>&1
@@ -62,10 +63,10 @@
 
 # check if script is already running
-date > $lockpath/lock-buildsequenceentries.txt >> $scriptlog 2>&1 
+date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
     0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
     1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
-         echo "-> buildsequenceentries is running -> exit" >> $scriptlog 2>&1
+         echo "-> $program is running -> exit" >> $scriptlog 2>&1
          date  >> $scriptlog 2>&1
          exit;;
@@ -81,5 +82,5 @@
    *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit" >> $scriptlog 2>&1
 	rm -v $todofile >> $scriptlog 2>&1
-	rm -v $lockpath/lock-buildsequenceentries.txt >> $scriptlog 2>&1
+	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
    	date  >> $scriptlog 2>&1
 	exit;;
@@ -92,5 +93,5 @@
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
    rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-buildsequenceentries.txt >> $scriptlog 2>&1
+   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -102,5 +103,5 @@
    echo "building sequence entries for date $date..." >> $scriptlog 2>&1
    year2=`echo $date | cut -c 1-4`
-   buildsequentriespath=$logpath/buildsequenceentries/$year2
+   buildsequentriespath=$logpath/$program/$year2
    makedir  $buildsequentriespath >> $scriptlog 2>&1
 
@@ -109,19 +110,18 @@
    case $check1 in
       1)   echo "check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1
-           setstatuslogpath=$logpath/setstatus/buildsequenceentries/$year2
-           makedir $setstatuslogpath >> $scriptlog 2>&1
-
-           check2=`root -q -b $macrospath/setstatus.C+\("\"$date\""\,"\"$table\""\,"\"$column\""\,"\"Now()\""\)  | tee $setstatuslogpath/setstatus-buildsequenceentries-$date.log | grep int | sed -e 's/(int)//'`
-           case $check2 in
-   	      1)   echo "check2=$check2 -> everything ok, status has been set" >> $scriptlog 2>&1;;
-   	      *)   echo "check2=$check2 -> ERROR -> step could not be set for $date" >> $scriptlog 2>&1;;
-           esac
+           statustime="Now()"
+           failed="NULL"
+           starttime="NULL"
+           failedtime="NULL"
+           var1=$year2
+           var2=$date
+           setstatus
    	   ;;
-      *)   echo "check1=$check1 -> ERROR - buildsequenceentries.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1;;
+      *)   echo "check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1;;
    esac
 done
 
 rm -v $todofile >> $scriptlog 2>&1 
-rm -v $lockpath/lock-buildsequenceentries.txt >> $scriptlog 2>&1 
+rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 
 
 set +C
