Fixed status display of distributed ppss.

This commit is contained in:
Louwrentius 2009-09-27 10:51:32 +00:00
parent 9a880c313d
commit fb3905ad11

17
ppss.sh
View File

@ -69,7 +69,7 @@ ARRAY_POINTER_FILE="$PPSS_DIR/ppss-array-pointer" # Pointer for keeping track of
JOB_LOG_DIR="$PPSS_DIR/job_log" # Directory containing log files of processed items. JOB_LOG_DIR="$PPSS_DIR/job_log" # Directory containing log files of processed items.
LOGFILE="$PPSS_DIR/ppss-log.txt" # General PPSS log file. Contains lots of info. LOGFILE="$PPSS_DIR/ppss-log.txt" # General PPSS log file. Contains lots of info.
STOP=0 # STOP job. STOP=0 # STOP job.
MAX_DELAY=2 MAX_DELAY=3
PERCENT="0" PERCENT="0"
PID="$$" PID="$$"
LISTENER_PID="" LISTENER_PID=""
@ -1329,6 +1329,8 @@ commando () {
log DEBUG "Processing item $ITEM" log DEBUG "Processing item $ITEM"
#Decide if an item must be transfered to the node.
#or be processed in-place (NFS / SMB mount?)
if [ "$TRANSFER_TO_SLAVE" == "0" ] if [ "$TRANSFER_TO_SLAVE" == "0" ]
then then
if [ -z "$SRC_DIR" ] && [ ! -z "$INPUT_FILE" ] if [ -z "$SRC_DIR" ] && [ ! -z "$INPUT_FILE" ]
@ -1388,6 +1390,7 @@ commando () {
echo -e "Status:\t\tSuccess - item has been processed." >> "$ITEM_LOG_FILE" echo -e "Status:\t\tSuccess - item has been processed." >> "$ITEM_LOG_FILE"
fi fi
#Remove the item after it has been processed as not to fill up disk space.
if [ "$TRANSFER_TO_SLAVE" == "1" ] if [ "$TRANSFER_TO_SLAVE" == "1" ]
then then
if [ -e "$ITEM" ] if [ -e "$ITEM" ]
@ -1415,11 +1418,11 @@ commando () {
if [ ! -z "$SSH_SERVER" ] if [ ! -z "$SSH_SERVER" ]
then then
log DEBUG "Uploading item log file $ITEM_LOG_FILE to master." log DEBUG "Uploading item log file $ITEM_LOG_FILE to master ~/$PPSS_HOME_DIR/$JOB_LOG"
scp -q $SSH_OPTS $SSH_KEY "$ITEM_LOG_FILE" $USER@$SSH_SERVER:~/$JOB_LOG_DIR/ scp -q $SSH_OPTS $SSH_KEY "$ITEM_LOG_FILE" $USER@$SSH_SERVER:~/$JOB_LOG_DIR
if [ ! "$?" == "0" ] if [ ! "$?" == "0" ]
then then
log ERROR "Uploading of item log file failed." log DEBUG "Uploading of item log file failed."
fi fi
fi fi
fi fi
@ -1524,12 +1527,10 @@ show_status () {
for x in `cat $NODES_FILE` for x in `cat $NODES_FILE`
do do
NODE=`get_status_of_node "$x" | awk '{ print $1 }'` NODE=`get_status_of_node "$x" | awk '{ print $1 }'`
RES=`exec_cmd "grep $NODE ~/$JOB_LOG_DIR/* >> /dev/null 2>&1"` RES=`exec_cmd "grep -i $NODE ~/$JOB_LOG_DIR/* | wc -l "`
if [ ! "$ERROR" == "0" ] if [ ! "$?" == "0" ]
then then
RES=0 RES=0
else
RES=`exec_cmd "grep $NODE ~/$JOB_LOG_DIR/* | wc -l"`
fi fi
let PROCESSED=$PROCESSED+$RES let PROCESSED=$PROCESSED+$RES
STATUS=`get_status_of_node "$x" | awk '{ print $2 }'` STATUS=`get_status_of_node "$x" | awk '{ print $2 }'`