Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7476)
@@ -46,11 +46,7 @@
 table=SequenceBuildStatus
 column=fSequenceEntriesBuilt
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m`
@@ -60,8 +56,6 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 # check if script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -75,15 +69,5 @@
 
 # get todo list
-echo "getting todo list..." >> $scriptlog 2>&1
-check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatus.log | grep int | sed -e 's/(int)//'`
-
-case $check0 in 
-   1)   echo "check0=$check0 -> everything ok, got todo list -> build sequence entries" >> $scriptlog 2>&1;;
-   *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit" >> $scriptlog 2>&1
-	rm -v $todofile >> $scriptlog 2>&1
-	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   	date  >> $scriptlog 2>&1
-	exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 # retrieve dates from todofile
@@ -92,8 +76,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -107,9 +88,10 @@
    buildsequentriespath=$logpath/$program/$year2
    makedir  $buildsequentriespath >> $scriptlog 2>&1
+   buildsequenceentrieslog=$buildsequentriespath/buildsequenceentries-$date.log
 
    echo "run $program..." >> $scriptlog 2>&1
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentriespath/buildsequenceentries-$date.log | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentrieslog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
@@ -125,9 +107,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1 
-rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7476)
@@ -37,30 +37,23 @@
 
 user=`whoami`
-program=checkfileavail
+program=checkfilesavail
 source /home/$user/Mars/datacenter/scripts/sourcefile
 
 table=SequenceProcessStatus
 column=fAllFilesAvail
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
-scriptlogpath=$logpath/run/checkfilesavail/`date +%Y/%m/%d`
+scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
 makedir $scriptlogpath
-
-scriptlog=$scriptlogpath/checkfilesforsequenceavail-$datetime.log
+scriptlog=$scriptlogpath/$program-$datetime.log
 
 date >> $scriptlog 2>&1
-
-makedir $getstatuslogpath >> $scriptlog 2>&1
 
 cd $mars
 
 # check if script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -74,15 +67,5 @@
 
 # get todo list
-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 -> step has to be repeated" >> $scriptlog 2>&1
-	rm -v $todofile >> $scriptlog 2>&1
-	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   	date  >> $scriptlog 2>&1
-	exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 # retrieve sequences from todofile
@@ -91,8 +74,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -105,7 +85,7 @@
    var1=$no
    var2=$no2
-   outpath=$logpath/$program/$no
-   echo "outpath: "$outpath  >> $scriptlog 2>&1 
+   checkfileavailpath=$logpath/$program/$no
    makedir $outpath  >> $scriptlog 2>&1 
+   checkfileavaillog=$checkfileavailpath/$program-$sequence.log
    
    sequencefile=$sequpath/$no/sequence$no2.txt
@@ -114,5 +94,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $outpath/checkfileavail-$sequence.log | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $checkfileavaillog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
@@ -128,7 +108,4 @@
 done
 
-rm -v $todofile  >> $scriptlog 2>&1 
-rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7476)
@@ -43,11 +43,7 @@
 table=DataSetProcessStatus
 column=fStarFilesAvail
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
@@ -57,10 +53,8 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 cd $mars
 
 # check if script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -74,15 +68,5 @@
 
 # get todo list
-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 -> could not get list -> exit" >> $scriptlog 2>&1
-        rm -v $todofile >> $scriptlog 2>&1
-   	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   	date  >> $scriptlog 2>&1
-	exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 datasets=(`cat $todofile`)
@@ -90,8 +74,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -142,7 +123,4 @@
 done
 
-rm -v $todofile  >> $scriptlog 2>&1 
-rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7476)
@@ -67,4 +67,5 @@
 char=28
 datetime=`date +%F-%H-%M-%S`
+lockfile=$lockpath/lock-copyscript.txt
 
 scriptlogpath=$logpath/run/copyscript/`date +%Y/%m/%d`
@@ -76,5 +77,5 @@
 
 # check if the script is already running
-date > $lockpath/lock-copyscript.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -95,5 +96,5 @@
 then
    echo "couldn't create checkfile -> exit script" >> $scriptlog 2>&1
-   rm -v $lockpath/lock-copyscript.txt >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -113,5 +114,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $lockpath/lock-copyscript.txt >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -292,5 +293,5 @@
 
 
-rm -v $lockpath/lock-copyscript.txt >> $scriptlog 2>&1
+rm -v $lockfile >> $scriptlog 2>&1
 date >> $scriptlog 2>&1
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/correcttime
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7476)
@@ -44,13 +44,9 @@
 table=RunProcessStatus
 column=fTimingCorrection
-date=NULL
-datetime=`date +%F_%T`
-year=`date +%Y`
 
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
-makedir $getstatuslogpath >> $scriptlog 2>&1
+todofile=$listpath/ToDo-$table-$column.txt
+lockfile=$lockpath/lock-$program.txt
 
-if [ -e $listpath/ToDo-$table-$column.txt ]
+if [ -e $todofile ]
 then 
    echo "$program is already running -> exit"
@@ -60,11 +56,6 @@
 cd $mars
 
-echo "getting list..."
-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";;
-   *)   echo "check0=$check0 -> ERROR -> step has to be repeated";;
-esac
+# get todo list
+getdolist  >> $scriptlog 2>&1
 
 # retrieving runs from todo file
@@ -73,6 +64,5 @@
 then 
    echo "nothing to do -> exit" 
-   rm -v $listpath/ToDo-$table-$column.txt
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -114,4 +104,4 @@
 done
 
-rm -v $listpath/ToDo-$table-$column.txt
+finish >> $scriptlog 2>&1
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7476)
@@ -50,11 +50,6 @@
 table=RunProcessStatus
 column=fDataCheckDone
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m`
@@ -63,6 +58,4 @@
 
 date >> $scriptlog 2>&1
-
-makedir $getstatuslogpath >> $scriptlog 2>&1
 
 # check if there are already todo files
@@ -84,11 +77,7 @@
    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 $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 $lockpath/lock-getting-$program-list.txt >> $scriptlog 2>&1
 fi
@@ -133,8 +122,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
 
@@ -227,7 +213,6 @@
    makedir $resetlogpath >> $scriptlog 2>&1
    resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log
-   echo "setstatuslogfile: $setstatuslog" >> $scriptlog 2>&1
-
-   check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
+
+   check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
    case $check5 in
       1)   echo "check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1
@@ -248,12 +233,7 @@
    var1=$date
    var2=$no2
-   setstatus
+   setstatus "stop" >> $scriptlog 2>&1
 done
 
-rm -v $todofile >> $scriptlog 2>&1 
-rm -v $lockfile >> $scriptlog 2>&1 
-
-set +C
-
-date  >> $scriptlog 2>&1
-
+finish >> $scriptlog 2>&1
+
Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7476)
@@ -46,11 +46,7 @@
 table=SequenceBuildStatus
 column=fExclusionsDone
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m`
@@ -60,8 +56,6 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 # check if the script is already running
-date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+date > $lockfile >> $scriptlog 2>&1 
 checklock0=$?
 case $checklock0 in 
@@ -74,16 +68,6 @@
 esac
 
-# get the todo list
-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 -> could not get todo list -> exit" >> $scriptlog 2>&1
-	rm -v $todofile >> $scriptlog 2>&1
-   	rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-	date  >> $scriptlog 2>&1
-	exit;;
-esac
+# get todo list
+getdolist  >> $scriptlog 2>&1
 
 dates=(`cat $todofile`)
@@ -91,8 +75,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -107,9 +88,10 @@
    doexclusionspath=$logpath/$program/$year2
    makedir $doexclusionspath >> $scriptlog 2>&1
+   doexclusionslog=$doexclusionspath/doexclusions-$date.log
 
    echo "run $program..." >> $scriptlog 2>&1
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionspath/doexclusions-$date.log | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionslog | grep int | sed -e 's/(int)//'`
 
    case $check1 in
@@ -124,9 +106,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1 
-rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7476)
@@ -45,11 +45,7 @@
 table=SequenceProcessStatus
 column=fFillCallisto
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
@@ -59,10 +55,8 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 cd $mars
 
 # check if the script is already running
-date > $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+date > $lockfile >> $scriptlog 2>&1
 checklock0=$?
 case $checklock0 in 
@@ -76,15 +70,5 @@
 
 # get todo file
-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 -> could not get list -> exit" >> $scriptlog 2>&1
-         rm -v $todofile >> $scriptlog 2>&1
-         rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-    	 date  >> $scriptlog 2>&1
-         exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 sequences=(`cat $todofile`)
@@ -92,8 +76,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -142,9 +123,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7476)
@@ -44,11 +44,7 @@
 table=DataSetProcessStatus
 column=fFillGanymed
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
@@ -58,10 +54,8 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 cd $mars
 
 # check if script is already running
-date > $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+date > $lockfile >> $scriptlog 2>&1
 checklock0=$?
 case $checklock0 in 
@@ -75,15 +69,5 @@
 
 # get todo list
-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 -> could not get list -> exit" >> $scriptlog 2>&1
-         rm -v $todofile >> $scriptlog 2>&1
-         rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-    	 date  >> $scriptlog 2>&1
-         exit;;
-esac
+getdolist  >> $scriptlog 2>&1
 
 # retrieve datasets from todo file
@@ -92,8 +76,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -128,9 +109,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7476)
@@ -44,11 +44,7 @@
 table=SequenceProcessStatus
 column=fFillStar
-date=NULL
-datetime=`date +%F-%H-%M-%S`
-year=`date +%Y`
 
 todofile=$listpath/ToDo-$table-$column.txt
-getstatuslogpath=$logpath/getstatus/$program/$year
-getstatuslog=$getstatuslogpath/getstatus-$program-$datetime.log
+lockfile=$lockpath/lock-$program.txt
 
 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
@@ -58,10 +54,8 @@
 date >> $scriptlog 2>&1
 
-makedir $getstatuslogpath >> $scriptlog 2>&1
-
 cd $mars
 
 # check if the script is already running
-date > $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+date > $lockfile >> $scriptlog 2>&1
 checklock0=$?
 case $checklock0 in 
@@ -75,15 +69,6 @@
 
 # get todo list
-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)//'`
+getdolist  >> $scriptlog 2>&1
 
-case $check0 in 
-    1)   echo "check0=$check0 -> everything ok -> run $program" >> $scriptlog 2>&1;;
-    *)   echo "check0=$check0 -> ERROR -> could not get list -> exit" >> $scriptlog 2>&1
-         rm -v $todofile >> $scriptlog 2>&1
-         rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-    	 date  >> $scriptlog 2>&1
-         exit;;
-esac
 
 # retrieve sequences from todo file
@@ -92,8 +77,5 @@
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
-   date  >> $scriptlog 2>&1
-   exit
+   finish >> $scriptlog 2>&1
 fi
 
@@ -128,9 +110,4 @@
 done
 
-rm -v $todofile >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
+finish >> $scriptlog 2>&1
 
-set +C
-
-date  >> $scriptlog 2>&1
-
Index: trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7476)
@@ -53,5 +53,5 @@
     0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
     1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
-         echo "-> getting list for insertdatasets is running -> exit" >> $scriptlog 2>&1
+         echo "-> insertdatasets is running -> exit" >> $scriptlog 2>&1
          date  >> $scriptlog 2>&1
          exit;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7475)
+++ trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7476)
@@ -54,5 +54,5 @@
     0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
     1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
-         echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1
+         echo "-> makecallistolinks is running -> exit" >> $scriptlog 2>&1
          date  >> $scriptlog 2>&1
          exit;;
