Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7938)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7944)
@@ -35,18 +35,14 @@
 #
 
+source `dirname $0`/sourcefile
+printprocesslog "INFO starting $0"
 program=checkfilesavail
-source `dirname $0`/sourcefile
-
 column=fAllFilesAvail
 
-lockfile=$lockpath/lock-$program.txt
-
-scriptlogpath=$runlogpath/$program
-makedir $scriptlogpath
-scriptlog=$scriptlogpath/$program-$datetime.log
-
+scriptlog=$runlogpath/$program-$datetime.log
 date >> $scriptlog 2>&1
 
 # check if script is already running
+lockfile=$lockpath/lock-$program.txt
 checklock  >> $scriptlog 2>&1
 
@@ -69,4 +65,5 @@
 do 
    echo "checking files for sequence $sequence..." >> $scriptlog 2>&1 
+   printprocesslog "INFO checking files for sequence $sequence"
    no=`printf %08d $sequence | cut -c 0-4`
    no2=`printf %08d $sequence`
@@ -84,12 +81,17 @@
 
    case $check1 in
-      1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
+      1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 
+           printprocesslog "INFO files available for sequence $sequence"
+           ;;
       2)   echo " check1=$check1 -> files not yet available -> continue..." >> $scriptlog 2>&1 
+           printprocesslog "INFO files not yet available for sequence $sequence"
            check="no"
            ;;
       0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 
+           printprocesslog "WARN connection to DB failed"
            check="no"
            ;;
-      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
+           printprocesslog "ERROR $program.C failed"
            com=$Ffilesavail
            check=$check1
