In the case of multiple weblogic versions and domain s on an application server, starting and closing is a very tedious process. First, it is necessary to enter the directory, then it is necessary to enable the appropriate commands. Once there are errors, the checking process is very patient. In order to simplify the process, the way of starting, closing and monitoring weblogic is first written down, so as to make up for future omissions:
It is divided into three documents:
profile.txt -- weblogic environment variable file.
move_env.sh - - - environment variable of move.sh
move.sh - - - Call script
profile.txt
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs JAVA_HOME=/data/data1/Middle/jdk1.5.0_04 PATH=$PATH:$HOME/bin: export PATH export WL1=/data/data1/Middle/weblogic/bea/user_projects/domains alias startgx='cd $WL1/trainCompetition && nohup ./startWebLogic.sh >>trainCompetition_181019.log &' alias stopgx='cd $WL1/trainCompetition && sh ./bin/stopWebLogic.sh' alias stoptx='cd $WL1/train_tx && sh ./bin/stopWebLogic.sh' alias starttx='cd $WL1/train_tx && nohup ./startWebLogic.sh >>train_tx_181023.log &' export WL2='/data/data1/Middle1036/user_projects/domains/danzheng_train' alias startdz='cd $WL2 && nohup ./startWebLogic.sh >>danzheng_train_181023.log &' alias stopdz='cd $WL2 && ./bin/stopWebLogic.sh' alias tailgx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/trainCompetition/trainCompetition_181019.log' alias tailtx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/train_tx/train_tx_181023.log' alias taildz='tail -f $WL2/danzheng_train_181023.log' #alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" sh ~/move.sh
move_env.sh
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs JAVA_HOME=/data/data1/Middle/jdk1.5.0_04 PATH=$PATH:$HOME/bin: export PATH export WL1=/data/data1/Middle/weblogic/bea/user_projects/domains alias startgx='cd $WL1/trainCompetition && nohup ./startWebLogic.sh >>trainCompetition_181019.log &' alias stopgx='cd $WL1/trainCompetition && sh ./bin/stopWebLogic.sh' alias stoptx='cd $WL1/train_tx && sh ./bin/stopWebLogic.sh' alias starttx='cd $WL1/train_tx && nohup ./startWebLogic.sh >>train_tx_181023.log &' export WL2='/data/data1/Middle1036/user_projects/domains/danzheng_train' alias startdz='cd $WL2 && nohup ./startWebLogic.sh >>danzheng_train_181023.log &' alias stopdz='cd $WL2 && ./bin/stopWebLogic.sh' alias tailgx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/trainCompetition/trainCompetition_181019.log' alias tailtx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/train_tx/train_tx_181023.log' alias taildz='tail -f $WL2/danzheng_train_181023.log' #alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;"
move.sh
source ~/move_env.sh echo '############################################################################' echo 'You are loging in contorl platform for weblogic domains , Now make you move:' echo '############################################################################' echo ' 1: start' echo ' 2: stop' echo ' 3: check log ' read -p "Make you move[1/2/3/enter]:" op1 if [ "$op1" == "1" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op2 if [ "$op2" == "1" ]; then startgx elif [ "$op2" == "2" ]; then starttx elif [ "$op2" == "3" ]; then startdz else echo 'Error , wrong choice' fi elif [ "$op1" == "2" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op2 if [ "$op2" == "1" ]; then stopgx elif [ "$op2" == "2" ]; then stoptx elif [ "$op2" == "3" ]; then stopdz else echo 'Error , wrong choice' fi elif [ "$op1" == "3" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op3 if [ "$op3" == "1" ]; then tailgx elif [ "$op3" == "2" ]; then tailtx elif [ "$op3" == "3" ]; then taildz else echo 'Error , wrong choice' fi else echo 'no choice ,just login !' fi