backup
This commit is contained in:
parent
43e68825a3
commit
a4b5fdc7c1
47
ppss
47
ppss
@ -38,7 +38,7 @@ trap 'kill_process' SIGINT
|
|||||||
|
|
||||||
# Setting some vars.
|
# Setting some vars.
|
||||||
SCRIPT_NAME="Distributed Parallel Processing Shell Script"
|
SCRIPT_NAME="Distributed Parallel Processing Shell Script"
|
||||||
SCRIPT_VERSION="2.51"
|
SCRIPT_VERSION="2.54"
|
||||||
|
|
||||||
# The first argument to this script can be a mode.
|
# The first argument to this script can be a mode.
|
||||||
MODES="node start config stop pause continue deploy status erase kill"
|
MODES="node start config stop pause continue deploy status erase kill"
|
||||||
@ -58,11 +58,6 @@ then
|
|||||||
PPSS_DIR="./ppss_dir"
|
PPSS_DIR="./ppss_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$PPSS_DIR" ]
|
|
||||||
then
|
|
||||||
mkdir -p "$PPSS_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
CONFIG=""
|
CONFIG=""
|
||||||
HOSTNAME=`hostname`
|
HOSTNAME=`hostname`
|
||||||
ARCH=`uname`
|
ARCH=`uname`
|
||||||
@ -376,6 +371,7 @@ add_var_to_config () {
|
|||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
||||||
--config|-C )
|
--config|-C )
|
||||||
CONFIG="$2"
|
CONFIG="$2"
|
||||||
|
|
||||||
@ -408,17 +404,26 @@ do
|
|||||||
|
|
||||||
if [ ! -e "./known_hosts" ]
|
if [ ! -e "./known_hosts" ]
|
||||||
then
|
then
|
||||||
if [ -e $SSH_KNOWN_HOSTS ]
|
if [ -e $SSH_KNOWN_HOSTS ]
|
||||||
then
|
then
|
||||||
cat $SSH_KNOWN_HOSTS > ./known_hosts
|
if [ ! "$SSH_KNOWN_HOSTS" == "known_hosts" ]
|
||||||
|
then
|
||||||
|
cat $SSH_KNOWN_HOSTS > ./known_hosts
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "File $SSH_KNOWN_HOSTS does not exist."
|
echo "File $SSH_KNOWN_HOSTS does not exist."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--working-dir|-w )
|
||||||
|
PPSS_DIR="$2"
|
||||||
|
add_var_to_config PPSS_DIR "$PPSS_DIR"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
|
||||||
--node|-n )
|
--node|-n )
|
||||||
NODES_FILE="$2"
|
NODES_FILE="$2"
|
||||||
add_var_to_config NODES_FILE "$NODES_FILE"
|
add_var_to_config NODES_FILE "$NODES_FILE"
|
||||||
@ -452,17 +457,9 @@ do
|
|||||||
|
|
||||||
-h )
|
-h )
|
||||||
showusage_normal
|
showusage_normal
|
||||||
if [ -e "$PPSS_DIR" ]
|
|
||||||
then
|
|
||||||
rm -rf "$PPSS_DIR"
|
|
||||||
fi
|
|
||||||
exit 1;;
|
exit 1;;
|
||||||
--help)
|
--help)
|
||||||
showusage_long
|
showusage_long
|
||||||
if [ -e "$PPSS_DIR" ]
|
|
||||||
then
|
|
||||||
rm -rf "$PPSS_DIR"
|
|
||||||
fi
|
|
||||||
exit 1;;
|
exit 1;;
|
||||||
--homedir|-H )
|
--homedir|-H )
|
||||||
if [ ! -z "$2" ]
|
if [ ! -z "$2" ]
|
||||||
@ -571,10 +568,18 @@ display_header () {
|
|||||||
log INFO "---------------------------------------------------------"
|
log INFO "---------------------------------------------------------"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_working_directory () {
|
||||||
|
|
||||||
|
if [ ! -e "$PPSS_DIR" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$PPSS_DIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Init all vars
|
# Init all vars
|
||||||
init_vars () {
|
init_vars () {
|
||||||
|
|
||||||
|
create_working_directory
|
||||||
|
|
||||||
if [ "$ARCH" == "Darwin" ]
|
if [ "$ARCH" == "Darwin" ]
|
||||||
then
|
then
|
||||||
@ -1736,6 +1741,7 @@ main () {
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
config )
|
config )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
log INFO "Generating configuration file $CONFIG"
|
log INFO "Generating configuration file $CONFIG"
|
||||||
add_var_to_config PPSS_LOCAL_TMPDIR "$PPSS_LOCAL_TMPDIR"
|
add_var_to_config PPSS_LOCAL_TMPDIR "$PPSS_LOCAL_TMPDIR"
|
||||||
@ -1745,6 +1751,7 @@ main () {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
stop )
|
stop )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
log INFO "Stopping PPSS on all nodes."
|
log INFO "Stopping PPSS on all nodes."
|
||||||
exec_cmd "touch $STOP_SIGNAL"
|
exec_cmd "touch $STOP_SIGNAL"
|
||||||
@ -1752,6 +1759,7 @@ main () {
|
|||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
pause )
|
pause )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
log INFO "Pausing PPSS on all nodes."
|
log INFO "Pausing PPSS on all nodes."
|
||||||
exec_cmd "touch $PAUSE_SIGNAL"
|
exec_cmd "touch $PAUSE_SIGNAL"
|
||||||
@ -1759,6 +1767,7 @@ main () {
|
|||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
continue )
|
continue )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
if does_file_exist "$STOP_SIGNAL"
|
if does_file_exist "$STOP_SIGNAL"
|
||||||
then
|
then
|
||||||
@ -1774,6 +1783,7 @@ main () {
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
deploy )
|
deploy )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
log INFO "Deploying PPSS on nodes."
|
log INFO "Deploying PPSS on nodes."
|
||||||
deploy_ppss
|
deploy_ppss
|
||||||
@ -1782,12 +1792,14 @@ main () {
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
status )
|
status )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
show_status
|
show_status
|
||||||
cleanup
|
cleanup
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
erase )
|
erase )
|
||||||
|
LOGFILE=/dev/null
|
||||||
display_header
|
display_header
|
||||||
log INFO "Erasing PPSS from all nodes."
|
log INFO "Erasing PPSS from all nodes."
|
||||||
erase_ppss
|
erase_ppss
|
||||||
@ -1795,6 +1807,7 @@ main () {
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
kill )
|
kill )
|
||||||
|
LOGFILE=/dev/null
|
||||||
for x in `ps ux | grep ppss | grep -v grep | grep bash | awk '{ print $2 }'`
|
for x in `ps ux | grep ppss | grep -v grep | grep bash | awk '{ print $2 }'`
|
||||||
do
|
do
|
||||||
kill "$x"
|
kill "$x"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEBUG="$1"
|
DEBUG="$1"
|
||||||
VERSION=2.51
|
VERSION=2.54
|
||||||
TMP_DIR="ppss"
|
TMP_DIR="ppss"
|
||||||
PPSS=ppss
|
PPSS=ppss
|
||||||
PPSS_DIR=ppss_dir
|
PPSS_DIR=ppss_dir
|
||||||
|
Loading…
Reference in New Issue
Block a user