Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7909)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7912)
@@ -53,48 +53,30 @@
 date >> $scriptlog 2>&1
 
-# finding todo file
-echo "checking if other todo-files are there" >> $scriptlog 2>&1
-if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
+# get todo file
+possibletodofiles=`ls -r $listpath/ToDo-*-$column-*.txt`  >> $scriptlog 2>&1
+if [ "$possibletodofiles" = "" ]
 then 
-   echo "other file(s) on disk " >> $scriptlog 2>&1
-   echo " -> choose one file and start calculation of image parameter" >> $scriptlog 2>&1
+   echo "ERROR: in $program no todofiles found => something went wrong in jobmanager"
+   finish >> $scriptlog 2>&1
 else
-   # check if getting of list is already running
-   checklock "getting list of" >> $scriptlog 2>&1
-   # get todo list
-   gettodo  >> $scriptlog 2>&1
-   rm -v $lockfile >> $scriptlog 2>&1
+   singleprocess="yes"
+   echo "todofiles: "${possibletodofiles[@]} >> $scriptlog 2>&1
+   for possibletodofile in ${possibletodofiles[@]}
+   do 
+      if ! ls $possibletodofile >> $scriptlog 2>&1
+      then 
+         echo "file is not on disk -> continue" >> $scriptlog 2>&1
+         continue
+      fi
+      lockfile=`echo $possibletodofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
+      checklock >> $scriptlog 2>&1
+      todofile=$possibletodofile
+   done
 fi
-
-# choosing todo file
-nr=bla
-echo "finding the right todo-file" >> $scriptlog 2>&1
-todofiles=`ls -r $listpath/ToDo-$table-$column-*`
-
-for todofile in ${todofiles[@]}
-do 
-   if ! ls $todofile >> $scriptlog 2>&1
-   then 
-      echo "file is not on disk -> continue" >> $scriptlog 2>&1
-      continue
-   fi
-   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
-   date > $lockfile >> $scriptlog 2>&1
-   checklock=$?
-   case $checklock in 
-       0)   echo "checklock=$checklock -> setting number" >> $scriptlog 2>&1
-            nr=${i}
-            break;;
-       1)   echo "checklock=$checklock -> file exists -> continue" >> $scriptlog 2>&1;;
-       *)   echo "checklock=$checklock -> something went completely wrong" >> $scriptlog 2>&1;;
-   esac
-done
-
-case $nr in
-   bla)      echo "everything is beeing processed -> exit" >> $scriptlog 2>&1
-             date  >> $scriptlog 2>&1
-             exit;;
-   12345678) echo "process nr: "$nr >> $scriptlog 2>&1;;
-esac
+if [ "$todofile" = "" ]
+then 
+   echo "no todofile found -> exit"  >> $scriptlog 2>&1
+   finish >> $scriptlog 2>&1
+fi
 
 # retrieve sequence from todo file
@@ -112,4 +94,5 @@
 for sequence in ${sequences[@]}
 do 
+  echo "run $program for sequence $sequence..." >> $scriptlog 2>&1
   no=`printf %08d $sequence | cut -c 0-4`
   no2=`printf %08d $sequence`
@@ -118,12 +101,8 @@
   outpath="$datapath/$program/$no/$no2"
   inpath=`echo $outpath | sed -e 's/star/callisto/'`
-  echo "inpath: "$inpath >> $scriptlog 2>&1
-  echo "outpath: "$outpath >> $scriptlog 2>&1
   makedir $outpath >> $scriptlog 2>&1
 
   sequfile="$sequpath/$no/sequence$no2.txt"
-  echo "sequfile: "$sequfile >> $scriptlog 2>&1
   
-  echo "run $program..." >> $scriptlog 2>&1
   setstatus "start" >> $scriptlog 2>&1
 
@@ -132,11 +111,11 @@
 
   case $check1 in
-     0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1;;
-     *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+     0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1;;
+     *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
           com=$Fstar
           check=$check1
           ;;
   esac
-  echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
+  
   setstatus "stop" >> $scriptlog 2>&1
 done
