Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7281)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7282)
@@ -56,15 +56,4 @@
 cd $mars
 
-date > $lockpath/lock-getting-callisto-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 callisto is running -> exit" >> $scriptlog 2>&1
-         date  >> $scriptlog 2>&1
-         exit;;
-    *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
-esac
-
 echo "checking if other todo-files are there" >> $scriptlog 2>&1
 if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
@@ -73,4 +62,15 @@
    echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
 else
+   date > $lockpath/lock-getting-callisto-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 callisto is running -> exit" >> $scriptlog 2>&1
+            date  >> $scriptlog 2>&1
+            exit;;
+       *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $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)//'`
@@ -80,11 +80,11 @@
        *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    esac
+   rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
 fi
 
-rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
 
 nr=bla
 echo "finding the right todo-file" >> $scriptlog 2>&1
-todofiles=`ls $listpath/ToDo-$table-$column-*`
+todofiles=`ls -r $listpath/ToDo-$table-$column-*`
 
 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
