#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"
## 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
# 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
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
## ---------------------------------------------------------------------------------