Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9221)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9355)
@@ -60,5 +60,4 @@
             rm -v $lockfile
          fi
-         date
          exit
       fi
@@ -90,5 +89,4 @@
       rm -v $lockfile
    fi
-   date
    printprocesslog "INFO finished $0"
    exit
@@ -184,10 +182,10 @@
    checklock0=$?
    case $checklock0 in
-      0)   echo " checklock0=$checklock0 -> continue " ;;
-      1)   echo " checklock0=$checklock0 -> file $lockfile exists"
-           date
+      0)   printprocesslog "INFO checklock0=$checklock0 -> continue " 
+           ;;
+      1)   printprocesslog "WARN checklock0=$checklock0 -> file $lockfile exists"
            $@
            exit;;
-      *)   echo " checklock0=$checklock0 -> something went completely wrong" ;;
+      *)   printprocesslog "ERROR checklock0=$checklock0 -> something went completely wrong" ;;
    esac
 }
@@ -218,15 +216,15 @@
 {
    case $@ in
-      start)   echo "setstatus start"
+      start)   printprocesslog "INFO setstatus start"
                starttime="Now()"
                ;;
        stop)   case $check in
-                  ok)  echo "setstatus stop - ok"
+                  ok)  printprocesslog "INFO setstatus stop - ok"
                        statustime="Now()"
                        ;;
-                  no)  echo "setstatus stop - nothing new"
+                  no)  printprocesslog "INFO setstatus stop - nothing new"
                        check="ok"
                        ;;
-                   *)  echo "setstatus stop - failed"
+                   *)  printprocesslog "INFO setstatus stop - failed"
                        starttime=noreset
                        if [ "$check" == "" ]
@@ -242,6 +240,5 @@
                esac
                ;;
-          *)   echo "error -> exit"
-               printprocesslog "ERROR function evalstatus got wrong variable"
+          *)   printprocesslog "ERROR function evalstatus got wrong variable"
                finish
                ;;
@@ -279,5 +276,5 @@
 {
    process=
-   echo "getting todo..."
+   printprocesslog "INFO getting todo..."
    getdbsetup
    getstepinfo
@@ -303,8 +300,7 @@
       query=$query" limit 0, $@ "
    fi
-   echo " QUERY: "$query
+   printprocesslog "INFO QUERY: "$query
    if ! process=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "`
    then
-      echo "ERROR could not query processes from db -> exit"
       printprocesslog "ERROR could not query processes from db (program: $program, function gettodo)"
       finish
@@ -313,5 +309,5 @@
    if [ "$process" = "" ]
    then
-      echo "  => nothing to do"
+      printprocesslog "INFO => nothing to do"
       finish
    else
@@ -340,8 +336,7 @@
    query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fProgramId) and isnull(fReturnCode) "
    query=$query" group by $column "
-#   echo " QUERY: "$query
+#   printprocesslog "INFO  QUERY: "$query
    if ! numproc=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "`
    then
-      echo "ERROR could not query number of todo proceses from db -> continue"
       printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)"
       cont
@@ -364,6 +359,5 @@
    if [ "$reset" = "no" ]
    then
-      echo "YOU CAN'T RESET $column for ${primaries[$s+$s]}!!!"
-      printprocesslog "ERROR you can't reset $column for ${primaries[$s+$s]}"
+      printprocesslog "ERROR You cannot reset $column for ${primaries[$s+$s]}"
       finish
    fi
@@ -391,8 +385,7 @@
       query=$query" and ${prims[$i]}='${primaries[$s*${#prims[@]}+$i]}' "
    done   
-   echo " QUERY: "$query
+   printprocesslog "INFO QUERY: "$query
    if ! mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
    then
-      echo "ERROR could not insert status into db -> exit"
       printprocesslog "ERROR could not set status in db (program: $program, function setstatus)"
       finish
