Index: trunk/Mars/datacenter/scripts/runceres
===================================================================
--- trunk/Mars/datacenter/scripts/runceres	(revision 9919)
+++ trunk/Mars/datacenter/scripts/runceres	(revision 10041)
@@ -37,19 +37,31 @@
 set -C
 
-# get sequence # 
-gettodo "1"
-run=${primaries[0]}
-cereskey=${primaries[1]}
-
-# lock sequ for cal
-lockfile=$lockpath/lock-$step-$run.$cereskey.txt
-checklock
+# get run # 
+numchanged=0
+while (( 0 < 21 ))
+do 
+   if ! [ $numchanged -eq 1 ]
+   then 
+      if ! [ "$run" = "" ] && ! [ "$cereskey" = "" ]
+      then
+         printprocesslog "INFO $program for run $run cereskey $cereskey is already running => request new number "
+      fi
+      gettodo "1" 
+      run=${primaries[0]}
+      cereskey=${primaries[1]}
+      if [ "$run" = "" ] || [ "$cereskey" = "" ]
+      then
+         printprocesslog "INFO nothing to do for $program "
+      fi
+   else
+      printprocesslog "INFO starting $program for run $run cereskey $cereskey"
+      break
+   fi
+   setstatus "start"
+done
 
 cd $mars
 
-# run calibration for sequence
-printprocesslog "INFO starting $program for run $run and ceres-setup $cereskey"
-
-setstatus "start"
+# run ceres for run
 
 setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc
