Project

General

Profile

Actions

Task #7035

open

Get end of run magic script

Added by Grave Xavier over 10 years ago. Updated over 10 years ago.

Status:
Feedback
Priority:
High
Assigned To:
Category:
-
Start date:
04/30/2014
Due date:
04/30/2014 (over 10 years late)
% Done:

100%

Estimated time:
Remaining (hours)

Description

In order to have as much information as possible to develop the Glocal Configuration Control aka GCC, it should be great to have the "end of run magic script" (tm).

Actions #1

Updated by Dosme Nicolas over 10 years ago

  • Due date set to 04/30/2014
  • Status changed from New to Feedback
  • Assigned To changed from Dosme Nicolas to Grave Xavier
  • % Done changed from 0 to 100

The script is ~prototype/bin/SAS (for example on narval-base)

Here is the code:

#!/bin/bash
if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then
 echo "Stop And Save" ;
 echo "Need to be in the zCurrentNarvalDir";
 echo "usage: SAS NUM_name";
 echo "will save the current run in the directory run_NUM_name";
 echo "will put back the shell in zCurrentNarvalDir";
 exit
fi
#check we are in zCurrentNarvalDir
strindex(){
 x="${1%%$2*}" 
 [[ $x = $1 ]] && echo -1 || echo ${#x}
}
#
a=$PWD
b=zCurrentNarvalDir
pos=`strindex $a $b`
lenh=`expr length $a`
diffe=`expr $lenh - $pos`
if [ "$diffe" == "17" ] ; then
 echo "presently in zCurrentNavalDir";
else
 echo "abort SAS not in zCurrentNavalDir" 
 exit 
fi

echo "saving the current directory in run_$1" 
sleep 5 
narval_shell --end_point http://localhost:$AWS_PORT set max_number_of_try 1 gsi event_builder
narval_shell --end_point http://localhost:$AWS_PORT set max_number_of_try 1 gsi merger
#
#
TOTO=0
while [ $TOTO -lt 5 ] ; do
 echo 'stopping event builders.... wait '
 sleep 1
 let TOTO=TOTO+1
done
narval_shell --end_point http://localhost:$AWS_PORT set action stop gsi
TOTO=0
while [ $TOTO -lt 20 ] ; do
 echo 'stoping narval ... wait'
 sleep 1
 let TOTO=TOTO+1
done 
if [ -n $1 ]
then
/agata/gammadaq/bin/SaveAgataRun_chmod.sh $1
fi
sleep 1
screen  -S narval -X quit 2>/dev/null;
screen  -S polyorb_cos_naming -X quit 2>/dev/null;
killall sub_system_coordinator  2>/dev/null; 
ssh -qn anode01 kill -9 -1 2>/dev/null;
ssh -qn anode02 kill -9 -1 2>/dev/null;
ssh -qn anode03 kill -9 -1 2>/dev/null;
ssh -qn anode04 kill -9 -1 2>/dev/null;
ssh -qn anode05 kill -9 -1 2>/dev/null;
ssh -qn anode06 kill -9 -1 2>/dev/null;
ssh -qn anode07 kill -9 -1 2>/dev/null;
ssh -qn anode08 kill -9 -1 2>/dev/null;
ssh -qn anode09 kill -9 -1 2>/dev/null;
ssh -qn anode10 kill -9 -1 2>/dev/null;
ssh -qn anode11 kill -9 -1 2>/dev/null;
ssh -qn anode12 kill -9 -1 2>/dev/null;
ssh -qn anode13 kill -9 -1 2>/dev/null;
ssh -qn anode14 kill -9 -1 2>/dev/null;
ssh -qn anode15 kill -9 -1 2>/dev/null;
ssh -qn anode16 kill -9 -1 2>/dev/null;
ssh -qn anode17 kill -9 -1 2>/dev/null;
ssh -qn anode18 kill -9 -1 2>/dev/null;
ssh -qn anode19 kill -9 -1 2>/dev/null;
ssh -qn anode20 kill -9 -1 2>/dev/null;
ssh -qn anode22 kill -9 -1 2>/dev/null;
ssh -qn anode23 kill -9 -1 2>/dev/null;
#extra node for backup
ssh -qn anode21 kill -9 -1 2>/dev/null;
ssh -qn anode24 kill -9 -1 2>/dev/null;
ssh -qn anodeds1 kill -9 -1 2>/dev/null;
ssh -qn anodeds2 kill -9 -1 2>/dev/null;
ssh -qn anodeds3 kill -9 -1 2>/dev/null;

echo "anode and narval clean" 
if [ -z $1 ]
then 
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 
echo "              " 
echo "" 
echo "" 
echo "                                         BE AWARE THAT THE DATA HAS NOT BEEN SAVED!!!" 
echo "                        " 
echo "                        " 
echo "" 
echo "" 
echo "//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////" 
fi

Actions #2

Updated by Grave Xavier over 10 years ago

  • Assigned To changed from Grave Xavier to Dosme Nicolas

In order to complete the picture can you fetch /agata/gammadaq/bin/SaveAgataRun_chmod.sh ? :)

Actions

Also available in: Atom PDF