Backup...
This commit is contained in:
parent
a63973fe73
commit
d5ea910e05
41
ppss
41
ppss
@ -81,6 +81,10 @@ SSH_OPTS="-o BatchMode=yes -o ControlPath=$SSH_SOCKET \
|
|||||||
-o ControlMaster=auto \
|
-o ControlMaster=auto \
|
||||||
-o Cipher=blowfish \
|
-o Cipher=blowfish \
|
||||||
-o ConnectTimeout=10 "
|
-o ConnectTimeout=10 "
|
||||||
|
|
||||||
|
SSH_OPTS_NOMP="-o BatchMode=yes -o GlobalKnownHostsFile=./known_hosts \
|
||||||
|
-o Cipher=blowfish \
|
||||||
|
-o ConnectTimeout=10 "
|
||||||
# Blowfish is faster but still secure.
|
# Blowfish is faster but still secure.
|
||||||
SSH_MASTER_PID=""
|
SSH_MASTER_PID=""
|
||||||
|
|
||||||
@ -274,18 +278,29 @@ kill_process () {
|
|||||||
|
|
||||||
exec_cmd () {
|
exec_cmd () {
|
||||||
|
|
||||||
|
STATUS="0"
|
||||||
CMD="$1"
|
CMD="$1"
|
||||||
|
NOMP="$2" # Disable multiplexing.
|
||||||
|
|
||||||
if [ ! -z "$SSH_SERVER" ]
|
if [ ! -z "$SSH_SERVER" ]
|
||||||
|
then
|
||||||
|
if [ -z "$NOMP" ]
|
||||||
then
|
then
|
||||||
log DEBUG "REMOTE EXEC"
|
log DEBUG "REMOTE EXEC"
|
||||||
ssh $SSH_OPTS $SSH_KEY $USER@$SSH_SERVER $CMD
|
ssh $SSH_OPTS $SSH_KEY $USER@$SSH_SERVER $CMD
|
||||||
return $?
|
STATUS=$?
|
||||||
|
elif [ "$NOMP" == "1" ]
|
||||||
|
then
|
||||||
|
log DEBUG "REMOTE EXEC NO MP"
|
||||||
|
ssh $SSH_OPTS_NOMP $SSH_KEY $USER@$SSH_SERVER $CMD
|
||||||
|
STATUS=$?
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log DEBUG "LOCAL EXEC"
|
log DEBUG "LOCAL EXEC"
|
||||||
eval "$CMD"
|
eval "$CMD"
|
||||||
return $?
|
STATUS=$?
|
||||||
fi
|
fi
|
||||||
|
return $STATUS
|
||||||
}
|
}
|
||||||
|
|
||||||
# this function makes remote or local checking of existence of items transparent.
|
# this function makes remote or local checking of existence of items transparent.
|
||||||
@ -906,10 +921,6 @@ start_ppss_on_node () {
|
|||||||
NODE="$1"
|
NODE="$1"
|
||||||
log DSPLY "Starting PPSS on node $NODE."
|
log DSPLY "Starting PPSS on node $NODE."
|
||||||
ssh $SSH_KEY $USER@$NODE -o ConnectTimeout=5 "cd $PPSS_HOME_DIR ; screen -d -m -S PPSS ~/$PPSS_HOME_DIR/$0 node --config ~/$PPSS_HOME_DIR/$CONFIG"
|
ssh $SSH_KEY $USER@$NODE -o ConnectTimeout=5 "cd $PPSS_HOME_DIR ; screen -d -m -S PPSS ~/$PPSS_HOME_DIR/$0 node --config ~/$PPSS_HOME_DIR/$CONFIG"
|
||||||
#
|
|
||||||
# TEMP REMOVE
|
|
||||||
#
|
|
||||||
ssh $SSH_KEY $USER@$NODE -o ConnectTimeout=5 "touch test123"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_server () {
|
test_server () {
|
||||||
@ -1710,18 +1721,23 @@ show_status () {
|
|||||||
then
|
then
|
||||||
SSH_KEY="-i $SSH_KEY"
|
SSH_KEY="-i $SSH_KEY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$INPUT_FILE" ]
|
if [ -z "$INPUT_FILE" ]
|
||||||
then
|
then
|
||||||
ITEMS=`exec_cmd "ls -1 $SRC_DIR | wc -l"`
|
ITEMS=`exec_cmd "ls -1 $SRC_DIR 2>/dev/null | wc -l" 1`
|
||||||
else
|
else
|
||||||
ITEMS=`exec_cmd "cat $PPSS_HOME_DIR/$INPUT_FILE | wc -l"`
|
ITEMS=`exec_cmd "cat $PPSS_HOME_DIR/$INPUT_FILE 2>/dev/null | wc -l" 1`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PROCESSED=`exec_cmd "ls -1 $ITEM_LOCK_DIR | wc -l"` 2>&1 >> /dev/null
|
ITEMS=`echo $ITEMS | sed s/\ //g`
|
||||||
TMP_STATUS=$((100 * $PROCESSED / $ITEMS))
|
|
||||||
|
|
||||||
|
if [ ! -z "$ITEMS" ] && [ ! "$ITEMS" == "0" ]
|
||||||
|
then
|
||||||
|
PROCESSED=`exec_cmd "ls -1 $ITEM_LOCK_DIR 2>/dev/null | wc -l" 1` 2>&1 >> /dev/null
|
||||||
|
TMP_STATUS=$((100 * $PROCESSED / $ITEMS))
|
||||||
log DSPLY "Status:\t\t$TMP_STATUS percent complete."
|
log DSPLY "Status:\t\t$TMP_STATUS percent complete."
|
||||||
|
else
|
||||||
|
log DSPLY "Status: UNKNOWN - is PPSS deployed on nodes?"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z $NODES_FILE ]
|
if [ ! -z $NODES_FILE ]
|
||||||
then
|
then
|
||||||
@ -1743,7 +1759,7 @@ show_status () {
|
|||||||
if [ ! "$NODE" == "UNKNOWN" ]
|
if [ ! "$NODE" == "UNKNOWN" ]
|
||||||
then
|
then
|
||||||
STATUS=`get_status_of_node "$x" | awk '{ print $2 }'`
|
STATUS=`get_status_of_node "$x" | awk '{ print $2 }'`
|
||||||
RES=`exec_cmd "grep -i $NODE ~/$PPSS_HOME_DIR/$JOB_LOG_DIR/* 2>/dev/null | wc -l "`
|
RES=`exec_cmd "grep -i $NODE ~/$PPSS_HOME_DIR/$JOB_LOG_DIR/* 2>/dev/null | wc -l " 1`
|
||||||
if [ ! "$?" == "0" ] || [ -z "$RES" ]
|
if [ ! "$?" == "0" ] || [ -z "$RES" ]
|
||||||
then
|
then
|
||||||
RES=0
|
RES=0
|
||||||
@ -1848,7 +1864,6 @@ main () {
|
|||||||
LOGFILE=/dev/null
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
show_status
|
show_status
|
||||||
cleanup
|
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
erase )
|
erase )
|
||||||
|
Loading…
Reference in New Issue
Block a user