动态Weblogic进程管理

2018-02-11 14:16:03来源:oschina作者:石岩人点击

分享

#!/bin/bash need_stop=`ps -ef|grep java|grep -viE "grep root"|awk '{print $2}'` pwdx $need_stop>stop_all_process.txt txtline=`cat stop_all_process.txt|wc -l` sed 's/[[:space:]]//g' stop_all_process.txt>process_file.txt rm -f stop_all_process.txt for ((j=1;j<=$txtline;j++)); do dir=`sed -n "${j}p" process_file.txt|awk -F ':' '{print $NF)'` echo "dir:"$dir if [ -d $dir ];then domain=`sed -n "${j}p" process_file.txt|awk -F '/' '{print $NF}'` pid=`cat process_file.txt|grep -i $domain|cut -d -f1` echo "Kill the Weblogic $domain service [$pid]" kill -9 $pid echo "The $domain service has been stoped!!" else echo "$pid No such process!!" fi done 注:上述代码为个人所有,转载需要注明来源。个人邮箱:[email protected];微信:shiyan31214

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台