rendered compatible with the new MainPipelineScript, which is now ran from runner bot
authorRami Rauch <rrauch@stanford.edu>
Wed, 13 Aug 2008 23:19:38 +0000 (23:19 +0000)
committerRami Rauch <rrauch@stanford.edu>
Wed, 13 Aug 2008 23:19:38 +0000 (23:19 +0000)
htswdataprod/scripts/MPListener

index efdbb123034e776dbe4753474a4a3a2788ee7b3f..676d41ead6eb958c8b5bd3b462cc7b86a61b244a 100755 (executable)
@@ -5,12 +5,13 @@
 #exptrackmainsc="$HOME/EXPTRACK/exp_track_main.py"
 exptrackmainsc="exp_track_main.py" 
 fcid=$1
-runfolder=$2
+fullpath=$2
+runfolder=`echo $fullpath | sed -e 's/^.*\///'`
 tocycle=$3
 
 ## Make sure we find the Firecrest folder, then check "Makefile" in the 3 directories
-firecrestdir=`ls Data | grep "^C1-$tocycle.*_Firecrest.*"`
-countdirs=`ls Data | grep -c "^C1-$tocycle.*_Firecrest.*"`
+firecrestdir=`ls $fullpath/Data | grep "^C1-$tocycle.*_Firecrest.*"`
+countdirs=`ls $fullpath/Data | grep -c "^C1-$tocycle.*_Firecrest.*"`
 if [ $countdirs == 1 ]
 then
   echo "" ## ok. firecrest folder '$firecrestdir' found"
@@ -23,7 +24,7 @@ else
     ## python $exptrackmainsc updsts $fcid $runfolder 3 ERROR:_Need_Specific_Firecrest_Dir
     exit
   else
-    echo "ERROR: Firecrest directory NOT FOUND."
+    echo "MPListener ERROR: Firecrest directory NOT FOUND."
     ## python $exptrackmainsc updsts $fcid $runfolder 3 ERROR:_Firecrest_Dir_Not_Found
     exit
   fi
@@ -38,9 +39,9 @@ fi
 # fi
 
 # ---------------------- Check for finished.txt in each main directory of the pipeline ------------                                
-firecrestfinished=Data/$firecrestdir/finished.txt
-bustfinished=Data/$firecrestdir/Bustard*_*/finished.txt
-gerfinished=Data/$firecrestdir/Bustard*_*/GERALD_*/finished.txt
+firecrestfinished=$fullpath/Data/$firecrestdir/finished.txt
+bustfinished=$fullpath/Data/$firecrestdir/Bustard*_*/finished.txt
+gerfinished=$fullpath/Data/$firecrestdir/Bustard*_*/GERALD_*/finished.txt
 # Wait for 48 hours max                                                                                                  
 timeremain=`expr 60 \* 60 \* 72`
 interval=10
@@ -91,16 +92,17 @@ done
 if [ $timeremain -gt 0 ]
 then
   echo "Gerald finished at `date`"
-  python $exptrackmainsc updsts $fcid $runfolder 3 Gerald_finished__Starting_DataAnalysis
+  python $exptrackmainsc updsts $fcid $runfolder 3 Gerald_finished
   echo "Finished LISTENING TO SOLEXA PIPELINE ..."
-  echo "Starting DATA ANALYSIS PHASE ..."
-  #$HOME/EXPTRACK/MPAnalysis $fcid $runfolder
-  MPCollectData $fcid $runfolder
+  echo "Starting DATA COLLECTION PHASE ..."
+  echo ".. here CollectData starts. Will run from the 'runner' bot."
+  ./MPCollectData $fcid $fullpath
 else
   echo "Script time expired while waiting for Gerald to finish."
   python $exptrackmainsc updsts $fcid $runfolder 2 Script_time_expired_during_Gerald
 fi
 
+echo "exiting MPListner .."
 exit
 
 ## ---------------------------------------------------------------------------------