首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

linux上自动重启tomcat

2012-09-03 
linux下自动重启tomcat假设脚本存为launch.sh,端口为8080#!/bin/shif [ $# -le 0 ]thenecho eg:./launch

linux下自动重启tomcat
假设脚本存为launch.sh,端口为8080

#!/bin/shif [ $# -le 0 ];then        echo 'eg:./launch.sh 8080'        exit 0fipath=$(pwd)port=$1num=100while [ $num -gt 0 ]do        echo $num        ps ax|grep $port|grep -v grep|grep -v ${0}|awk '{print $1}' -> tmp.txt        for pid in $(cat tmp.txt)        do        {                echo "kill -9 $pid"                kill -9 $pid         }        done        rm -rf tmp.txt        $path/./startup.sh        sleep 300        $((num--))done

热点排行