Index: /trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7322)
+++ /trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7323)
@@ -113,6 +113,6 @@
     query+=Form(" ORDER BY %s.%s DESC ", table.Data(), rc.GetValue(table+".Primary", ""));
 
-    if (table=="RunProcessStatus")
-        query+="LIMIT 0, 500";
+//    if (table=="RunProcessStatus")
+//        query+="LIMIT 0, 500";
 
     cout << "query: " << query << endl;
@@ -129,7 +129,8 @@
     TSQLRow *row=0;
 
-    if ((table=="SequenceProcessStatus" && column=="fCallisto") ||
-        (table=="SequenceProcessStatus" && column=="fStar") ||
-        (table=="DataSetProcessStatus" && column=="fGanymed"))
+    if ((table=="SequenceProcessStatus" && column=="fCallisto")      ||
+        (table=="SequenceProcessStatus" && column=="fStar")          ||
+        (table=="RunProcessStatus"      && column=="fDataCheckDone") ||
+        (table=="DataSetProcessStatus"  && column=="fGanymed"))
     {
         while ((row = res->Next()))
Index: /trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7322)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7323)
@@ -40,5 +40,5 @@
 year=`date +%Y`
 
-todofile=$listpath/ToDo-$table-$column.txt
+todofile=$listpath/ToDo-$table-$column
 getstatuslogpath=$logpath/getstatus/dodatacheck/$year
 getstatuslog=$getstatuslogpath/getstatus-dodatacheck-$datetime.log
@@ -53,29 +53,70 @@
 makedir $getstatuslogpath >> $scriptlog 2>&1
 
-lockfile=$lockpath/lock-dodatacheck.txt
-date > $lockfile >> $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 "-> for datacheck is running -> exit" >> $scriptlog 2>&1
-         date  >> $scriptlog 2>&1
-         exit;;
-    *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
+echo "checking if other todo-files are there" >> $scriptlog 2>&1
+if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
+then 
+   echo "other file(s) on disk " >> $scriptlog 2>&1
+   echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
+else
+   date > $lockpath/lock-getting-dodatacheck-list.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 "-> getting list for dodatacheck is running -> exit" >> $scriptlog 2>&1
+            date  >> $scriptlog 2>&1
+            exit;;
+       *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
+   esac
+
+   if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
+   then
+      echo "other file(s) on disk " >> $scriptlog 2>&1
+      echo " -> choose one file and start datacheck" >> $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 -> do datacheck" >> $scriptlog 2>&1;;
+          *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
+      esac
+   fi
+   rm -v $lockpath/lock-getting-dodatacheck-list.txt >> $scriptlog 2>&1
+fi
+
+
+nr=bla
+echo "finding the right todo-file" >> $scriptlog 2>&1
+todofiles=`ls -r $listpath/ToDo-$table-$column-*`
+
+echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
+
+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
 
-
-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 -> no todofile -> exit " >> $scriptlog 2>&1
-        rm -v $lockfile >> $scriptlog 2>&1
-        date  >> $scriptlog 2>&1
-        exit
-        ;;
-esac
 
 runs=(`cat $todofile`)
@@ -139,4 +180,5 @@
                continue 2;;
       esac
+      check2=1
    done
    
@@ -145,9 +187,9 @@
    fillsinopelogfile=$fillsinopepath/fillsinope-$no2.log
 
-   echo "doing filldotraw..." >> $scriptlog 2>&1
+   echo "doing fillsinope..." >> $scriptlog 2>&1
    check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'`
 
    case $check3 in 
-       1)   echo "check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1
+       1)   echo "check3=$check3 -> everything ok -> set exclusions..." >> $scriptlog 2>&1
             ;;
        *)   echo "check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
