Bacup
This commit is contained in:
parent
39c1ecf542
commit
ed55ae5137
51
ppss.sh
51
ppss.sh
@ -250,7 +250,7 @@ while [ $# -gt 0 ]
|
||||
do
|
||||
case $1 in
|
||||
-config )
|
||||
CONFIG=$2
|
||||
CONFIG="$2"
|
||||
|
||||
if [ "$MODE" == "config" ]
|
||||
then
|
||||
@ -507,6 +507,21 @@ check_status () {
|
||||
|
||||
}
|
||||
|
||||
erase_ppss () {
|
||||
|
||||
echo "Are you realy sure you want to erase PPSS from all nades!?"
|
||||
read YN
|
||||
|
||||
if [ "$YN" == "y" ]
|
||||
then
|
||||
for x in `cat $NODES_FILE`
|
||||
do
|
||||
log INFO "Erasing PPSS from node $x."
|
||||
exec_cmd "rm -rf $PPSS_HOME_DIR"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
deploy_ppss () {
|
||||
|
||||
ERROR=0
|
||||
@ -1018,6 +1033,29 @@ start_all_workers () {
|
||||
done
|
||||
}
|
||||
|
||||
show_status () {
|
||||
|
||||
source $CONFIG
|
||||
if [ ! -z "$SSH_KEY" ]
|
||||
then
|
||||
SSH_KEY="-i $SSH_KEY"
|
||||
fi
|
||||
|
||||
if [ -z "$INPUT_FILE" ]
|
||||
then
|
||||
ITEMS=`exec_cmd "ls -1 $SRC_DIR | wc -l"`
|
||||
else
|
||||
ITEMS=`exec_cmd "cat $INPUT_FILE | wc -l"`
|
||||
fi
|
||||
|
||||
PROCESSED=`exec_cmd "ls -1 $ITEM_LOCK_DIR | wc -l"`
|
||||
#STATUS=`echo "100 * $PROCESSED / $ITEMS" | bc`
|
||||
STATUS=$((100 * $PROCESSED / $ITEMS))
|
||||
|
||||
echo "$STATUS percent complete."
|
||||
|
||||
}
|
||||
|
||||
|
||||
# If this is called, the whole framework will execute.
|
||||
main () {
|
||||
@ -1056,7 +1094,7 @@ main () {
|
||||
|
||||
log INFO "Generating configuration file $CONFIG"
|
||||
cleanup
|
||||
exit
|
||||
exit 0
|
||||
;;
|
||||
|
||||
stop )
|
||||
@ -1064,10 +1102,17 @@ main () {
|
||||
;;
|
||||
deploy )
|
||||
deploy_ppss
|
||||
cleanup
|
||||
exit 0
|
||||
;;
|
||||
show )
|
||||
status )
|
||||
show_status
|
||||
# some show command
|
||||
;;
|
||||
erase )
|
||||
erase_ppss
|
||||
cleanup
|
||||
exit 0
|
||||
* )
|
||||
showusage
|
||||
exit 1;;
|
||||
|
Loading…
Reference in New Issue
Block a user