Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7908)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7909)
@@ -68,4 +68,14 @@
    * steps.rc: 
      - fixed typo
+
+   * datacenter/scripts/buildsequenceentries, 
+     datacenter/scripts/checkfilesforsequenceavail, 
+     datacenter/scripts/checkstardone, datacenter/scripts/correcttime, 
+     datacenter/scripts/dodatacheck, datacenter/scripts/doexclusions, 
+     datacenter/scripts/fillcallisto, datacenter/scripts/fillganymed, 
+     datacenter/scripts/fillstar, datacenter/scripts/runcallisto, 
+     datacenter/scripts/runganymed, datacenter/scripts/runstar, 
+     datacenter/scripts/writesequencefiles:
+     - implemented usage of gettodo instead of getdolist (faster)
 
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written.
 # Then the sequences are built for each date in the todolist using the 
 # macro buildsequenceentries.C
@@ -41,10 +41,6 @@
 set -C
 
-cd $mars
-
-table=SequenceBuildStatus
 column=fSequenceEntriesBuilt
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -59,5 +55,5 @@
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 # retrieve dates from todofile
@@ -68,4 +64,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 echo "dates: "${dates[@]} >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then for each sequence the availability of the files (raw, cc, caco) is 
 # checked by using the macro checkfilesavail.C 
@@ -39,8 +39,6 @@
 source `dirname $0`/sourcefile
 
-table=SequenceProcessStatus
 column=fAllFilesAvail
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -51,11 +49,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 # retrieve sequences from todofile
@@ -66,4 +62,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written
 # Then for each dataset the sequences are extracted from the datasetfile 
 # and for each sequence the availability of the star files checked by using 
@@ -40,8 +40,6 @@
 source `dirname $0`/sourcefile
 
-table=DataSetProcessStatus
 column=fStarFilesAvail
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -52,11 +50,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodot  >> $scriptlog 2>&1
 
 datasets=(`cat $todofile`)
@@ -66,4 +62,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 echo "datasets: "${datasets[@]} #>> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/correcttime
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written
 # Then for each run the timing correction is done 
 # If this was successful, the status is inserted into the database using 
@@ -41,8 +41,6 @@
 source `dirname $0`/sourcefile
 
-table=RunProcessStatus
 column=fTimingCorrection
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -53,8 +51,6 @@
 fi
 
-cd $mars
-
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 # retrieving runs from todo file
@@ -65,4 +61,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 echo "runs: "${runs[@]}
Index: trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then for each run the following steps are done: 
 #  - filldotraw.C
@@ -45,10 +45,6 @@
 set -C
 
-cd $mars
-
-table=RunProcessStatus
 column=fDataCheckDone
 
-todofile=$listpath/ToDo-$table-$column
 lockfile=$lockpath/lock-getting-$program-list.txt
 
@@ -69,5 +65,5 @@
    checklock "getting list of" >> $scriptlog 2>&1
    # get todo list
-   getdolist  >> $scriptlog 2>&1
+   gettodolist  >> $scriptlog 2>&1
    rm -v $lockfile >> $scriptlog 2>&1
 fi
@@ -114,4 +110,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # processing run(s)
Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then the run are excluded for each date in the todolist using the 
 # macro doexclusions.C
@@ -41,10 +41,6 @@
 set -C
 
-cd $mars
-
-table=SequenceBuildStatus
 column=fExclusionsDone
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -59,5 +55,5 @@
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 dates=(`cat $todofile`)
@@ -67,4 +63,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # do exclusions for each date in the todo file
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then for each sequence in the todo list the calibration results are 
 # filled into the table Calibration in the database using the macros 
@@ -42,8 +42,6 @@
 set -C
 
-table=SequenceProcessStatus
 column=fFillCallisto
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -54,11 +52,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if the script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo file
-getdolist  >> $scriptlog 2>&1
+gettodolist  >> $scriptlog 2>&1
 
 sequences=(`cat $todofile`)
@@ -68,4 +64,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # fill information into the database for all sequences in the todo file
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then for each dataset in the todo list the ganymed results are filled 
 # into the table Ganymed in the database using the macro fillganymed.C
@@ -41,8 +41,6 @@
 set -C
 
-table=DataSetProcessStatus
 column=fFillGanymed
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -53,11 +51,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 # retrieve datasets from todo file
@@ -68,4 +64,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # run fillganymed for datasets
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then for each sequence in the todo list the star results are filled 
 # into the table Star in the database using the macro fillstar.C
@@ -41,8 +41,6 @@
 set -C
 
-table=SequenceProcessStatus
 column=fFillStar
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -53,11 +51,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if the script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 
@@ -69,4 +65,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # run fillstar for sequences
Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7909)
@@ -46,9 +46,7 @@
 callistorcmarapr05=$setuppath/$program/callisto_MarApr05.rc
 
-table=SequenceProcessStatus
 column=fCallisto
 #pno=500 # number of processes, i.e. number of todo-files
 
-todofile=$listpath/ToDo-$table-$column
 lockfile=$lockpath/lock-getting-$program-list.txt
 
@@ -58,6 +56,4 @@
 
 date >> $scriptlog 2>&1
-
-cd $mars
 
 # get todo file
@@ -71,5 +67,5 @@
    checklock "getting list of" >> $scriptlog 2>&1
    # get todo list
-   getdolist  >> $scriptlog 2>&1
+   gettodo  >> $scriptlog 2>&1
    rm -v $lockfile >> $scriptlog 2>&1
 fi
@@ -113,4 +109,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # run calibration for sequence(s)
Index: trunk/MagicSoft/Mars/datacenter/scripts/runganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7909)
@@ -42,9 +42,7 @@
 set -C
 
-table=DataSetProcessStatus
 column=fGanymed
 #pno=24 # number of processes, i.e. number of todo-files
 
-todofile=$listpath/ToDo-$table-$column
 lockfile=$lockpath/lock-getting-$program-list.txt
 
@@ -54,6 +52,4 @@
 
 date >> $scriptlog 2>&1
-
-cd $mars
 
 # finding todo file
@@ -67,5 +63,5 @@
    checklock "getting list of" >> $scriptlog 2>&1
    # get todo list
-   getdolist  >> $scriptlog 2>&1
+   gettodo  >> $scriptlog 2>&1
    rm -v $lockfile >> $scriptlog 2>&1
 fi
Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7909)
@@ -42,9 +42,7 @@
 set -C
 
-table=SequenceProcessStatus
 column=fStar
 #pno=500 # number of processes, i.e. number of todo-files
 
-todofile=$listpath/ToDo-$table-$column
 lockfile=$lockpath/lock-getting-$program-list.txt
 
@@ -54,6 +52,4 @@
 
 date >> $scriptlog 2>&1
-
-cd $mars
 
 # finding todo file
@@ -67,5 +63,5 @@
    checklock "getting list of" >> $scriptlog 2>&1
    # get todo list
-   getdolist  >> $scriptlog 2>&1
+   gettodo  >> $scriptlog 2>&1
    rm -v $lockfile >> $scriptlog 2>&1
 fi
@@ -110,4 +106,6 @@
 fi
 
+cd $mars
+
 # run star for sequence
 echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7909)
@@ -296,5 +296,7 @@
       done
    fi
-   query=$query" isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) order by $primary desc "
+   query=$query" isnull($column) "
+   query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) "
+   query=$query" order by $primary desc "
    if [ "$singleprocess" = "yes" ]
    then 
@@ -311,18 +313,18 @@
       if [ "$singleprocess" = "yes" ]
       then 
-         listfile=$listpath/ToDo-$table-$column-$process.txt
+         todofile=$listpath/ToDo-$table-$column-$process.txt
          echo "  => found $process"
       else
-         listfile=$listpath/ToDo-$table-$column.txt
+         todofile=$listpath/ToDo-$table-$column.txt
          echo "found processes"
       fi
-#      echo " list: "$listfile
+#      echo " list: "$todofile
       
-      if ls $listfile > /dev/null 2>&1
+      if ls $todofile > /dev/null 2>&1
       then
-         echo "$listfile exists already"
+         echo "$todofile exists already"
          contex 
       fi
-      echo $process > $listfile
-   fi
-}
+      echo $process > $todofile
+   fi
+}
Index: trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7908)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7909)
@@ -29,5 +29,5 @@
 #
 # After checking, if the script is already running, the todolist is 
-# written by using the macro getdolist.C
+# written 
 # Then the sequence file is written for each sequence in the todolist using
 # the macro writesequencefile.C
@@ -41,8 +41,6 @@
 set -C
 
-table=SequenceProcessStatus
 column=fSequenceFileWritten
 
-todofile=$listpath/ToDo-$table-$column.txt
 lockfile=$lockpath/lock-$program.txt
 
@@ -53,11 +51,9 @@
 date >> $scriptlog 2>&1
 
-cd $mars
-
 # check if script is already running
 checklock  >> $scriptlog 2>&1
 
 # get todo list
-getdolist  >> $scriptlog 2>&1
+gettodo  >> $scriptlog 2>&1
 
 # get sequences from todo file
@@ -68,4 +64,6 @@
    finish >> $scriptlog 2>&1
 fi
+
+cd $mars
 
 # write sequence file for all sequences in todo file
