Index: trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/jobmanager	(revision 7933)
+++ trunk/MagicSoft/Mars/datacenter/scripts/jobmanager	(revision 7936)
@@ -36,9 +36,10 @@
 
 echo "" >> $jmscriptlog 2>&1
-echo `date`": starting jobmanager" >> $jmscriptlog 2>&1
+echo "starting jobmanager ("`date`")" >> $jmscriptlog 2>&1
 makedir $jmlogpath
 makedir $listpath >> $jmscriptlog 2>&1
 makedir $lockpath >> $jmscriptlog 2>&1
 
+prev=$max
 notcount=0
 while (( $notcount < 100 ))
@@ -72,7 +73,11 @@
       num=`echo "((( $i + 1 ) * 24 ) + ( $hour + 1 ) ) - 24 - 1 " | bc `
       pnoscript=${pnos[$num]}
+      if [ $prev -eq 0 ]
+      then
+         echo " prev=0 => resetting pnoscript [$pnoscript] to max [$max]" >> $jmscriptlog 2>&1
+         pnoscript=$max
+      fi
       echo " found $queued jobs in the queue (incl. running jobs) [allowed $totalpno]" >> $jmscriptlog 2>&1
-      echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs) [allowed $pnoscript]" >> $jmscriptlog 2>&1
-#      echo "  => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" >> $jmscriptlog 2>&1
+      echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs [$runningscript]) [allowed $pnoscript] - not running: $stillinqueue" >> $jmscriptlog 2>&1
       
       if [ "$queued" -gt "$totalpno" ]
@@ -87,16 +92,15 @@
 
       # check if there's something to do
-      getstatus
+      getstatus >> $jmscriptlog 2>&1
+      echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&1
       if [ "$numproc" = "" ]
       then 
+         prev=0
          cont >> $jmscriptlog 2>&1
       fi
-      if ! [ $numproc -gt 0 ]
-      then
-         cont >> $jmscriptlog 2>&1
-      fi
+      prev=$max
       if [ $numproc -lt $stillinqueue ]
       then 
-         echo "numproc($numproc) -lt stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1
+         echo " numproc($numproc) -lt stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1
          cont >> $jmscriptlog 2>&1
       fi
@@ -107,4 +111,5 @@
       makedir $condordir >> $jmscriptlog 2>&1
       
+      echo " committing 1 ${scripts[$i]} to condor" >> $jmscriptlog 2>&1
       if ! /usr/local/bin/condor_submit -a path=$scriptspath -a prog=${scripts[$i]} -a date=$date2 -a dir=$condordir $scriptspath/run.condor 2>> $jmerrorlog
       then 
@@ -114,4 +119,5 @@
          sleep $errorsleeptime
       fi
+      date >> $jmscriptlog 2>&1
       echo "" >> $jmscriptlog 2>&1
    done
Index: trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher	(revision 7933)
+++ trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher	(revision 7936)
@@ -38,5 +38,5 @@
 scriptlog=$sllogpath/scriptlauncher`date +%F`.log
 
-date  >> $scriptlog 2>&1
+echo `date`": starting $0 $@"  >> $scriptlog 2>&1
 
 path=`dirname $0`
@@ -44,5 +44,5 @@
 date2=`date +%Y-%m-%d`
 condordir=$logpath/condor/$date
-makedir $condordir
+makedir $condordir >> $scriptlog 2>&1
 
 for i in $@
@@ -52,12 +52,13 @@
       continue
    fi
-   echo "launching $i..." >> $scriptlog 2>&1
+   echo " launching $i..." >> $scriptlog 2>&1
    pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2`  2>$errorlog
    if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog
    then
-      echo " waiting for $i to be done..." >> $scriptlog 2>&1
+      echo "  waiting for $i to be done..." >> $scriptlog 2>&1
       /usr/local/bin/condor_wait $condordir/condor-$date2.log $pid >/dev/null 2>$errorlog
    fi
 done
 echo `date`": all done/submitted." >> $scriptlog 2>&1
+echo "" >> $scriptlog 2>&1
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7933)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7936)
@@ -38,4 +38,7 @@
 
 webpath=/www/htdocs/datacenter
+
+processlogpath=$logpath/run/`date +%Y/%m/%d`
+processlog=$processlogpath/process`date +%F`.log
 
 datetime=`date +%F-%H-%M-%S`
@@ -105,4 +108,10 @@
 # defined
 
+function printprocesslog
+{
+   makedir $processlogpath
+   echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "`basename $0`"["$$"] "$@ >> $processlog
+}
+   
 # function to exit a script properly
 function finish()
@@ -353,6 +362,7 @@
 function getstatus()
 {
+   printprocesslog "this is a test"`date`
    numproc=
-   echo "getting status..."
+#   echo "getting status..."
    getdbsetup 
    column=${scriptscolname[$i]}
