Index: trunk/MagicSoft/Mars/datacenter/scripts/runganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7469)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7477)
@@ -45,12 +45,8 @@
 table=DataSetProcessStatus
 column=fGanymed
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 #pno=24 # number of processes, i.e. number of todo-files
 
 todofile=$listpath/ToDo-$table-$column
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-getting-$program-list.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
@@ -60,10 +56,8 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 cd $mars
 
 # check if getting of list is already running
-date > $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1
+date > $lockfile >> $scriptlog 2>&1
 checklock0=$?
 case $checklock0 in 
@@ -83,14 +77,8 @@
    echo " -> choose one file and run $program" >> $scriptlog 2>&1
 else
-   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 -> run $program" >> $scriptlog 2>&1;;
-       *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
-   esac
+   # get todo list
+   getdolist  >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
 fi
-
-rm -v $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1
 
 # choosing todo file
@@ -130,8 +118,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockfile >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -178,9 +163,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1
-rm -v $lockfile >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
