Shell重启Tomcat脚本
#!/bin/bash echo -e "\n\n\n" #force kill flag,if equal [f] to force kill all
flag="HelloShell"
if test $# -gt
then
flag=$
fi pids=`ps -ef|grep tomcat | grep -v "grep" | awk '{print $2}'`
#pids=`ps -ef|grep -w tomcat | grep -v "grep" | awk '{print $2}'` count=
pid_num=
for pid in ${pids}
do
pid_num=${pid}
count=`expr ${count} + `
done if test $[count] -gt
then
if test $flag = "f"
then
for pid in ${pids}
do
echo "kill " ${pid}
kill - ${pid}
done
echo "Force kill more progress success!"
else
echo "Exist more progress is running, Input param [f] to force kill."
fi
else
if test $[count] -eq
then
kill - ${pid_num}
echo "Kill " ${pid_num} " Success!"
else
echo "Clear!"
fi
fi # start
bash /root/soft/apache-tomcat-7.0./bin/startup.sh echo -e "\n\n\n"
Shell重启Tomcat脚本的更多相关文章
- shell 重启 tomcat 脚本
#!/bin/sh # author hapday -- export TOMCAT_HOME=/usr/local/tomcat-pms tomcat_pid=$(ps -ef | grep ${T ...
- 阿里云 crp kelude远程部署tomcat8 重启tomcat脚本
部署包路径:/usr/local/tomcat/webapps 应用服务启动脚本路径:/usr/local/tomcat/bin/restart.sh 部署授权帐号:tomcat restart.sh ...
- Linux 重启Tomcat脚本
#!/bin/test_restart.sh #Author : Javen #Desc : restart tomcat-test tomcatpath="/home/local/test ...
- linux系统下重启tomcat的shell脚本
linux系统下重启tomcat的shell脚本: #!/bin/shtomcat_home=/opt/apache-tomcat- #找到tomcat进程的id并kill掉 ps -ef |grep ...
- shell脚本重启tomcat
1. 新建shell空脚本文件,如 /home/tr.sh,并设置权限 # chmod 750 /home/tr.sh 2. 设置文件形式: # sed -e 's/\^M//g' /home/tr. ...
- linux定时重启tomcat服务的脚本学习
要求:在linux中定时重启一个tomcat服务 一:shell脚本即Shell Script [1],Shell脚本与Windows/Dos下的批处理相似,也就是用各类命令预先放入到一个文件中,方便 ...
- 自动监控tomcat脚本并且执行重启操作
#!/bin/sh # func:自动监控tomcat脚本并且执行重启操作 # author:reed # date:// # 定义环境变量 MYPATH=/usr/local/jdk/bin exp ...
- java通过ftp和sftp上传war包上传到Linux服务器实现自动重启tomcat的脚本代码
ar包自动上传Linux并且自动重启tomcat 用的是jdk1.7出的文件监控 支持ftp和sftp,支持多服务器负载等 配置好config 非maven项目导入直接使用 #\u76D1\u542C ...
- Linux 定时重启 Tomcat、重启Keepalived
1.在 tomcat 目录新建一个.sh 文件: vi restartTomcat.sh 2.输入内容: #!/bin/bash# author: Linnuo # date: -- # Filena ...
随机推荐
- Android代码笔记
1. 如何监听Android的短信收发,自动填充验证码? getContentResolver().registerContentObserver(Uri.parse(SMS_URI_ALL), tr ...
- php接入图灵机器人
官网:http://www.tuling123.com 文档:https://www.kancloud.cn/turing/www-tuling123-com/718218 注册账号获取:apikey ...
- 操作iframe的一些方法
//父页面操作iframe里的内容 oInput.onclick=function(){ var oBox = oIframe.contentWindow.document.getElementByI ...
- 在邮箱服务器上执行Powershell命令Get-MessageTrackingLog 报错
开启对应的服务即可. 中文环境: 英文环境:
- Luogu P4901 排队 fib数列+树状数组+倍增
这题让我升华..还好只重构了一遍 首先我们发现:$n$较小时,整个队伍的形态 跟 $n$ 比较大时的局部是一样的 所以我们预处理出这个队伍的形态,和每一行每个位置的质因子个数的前缀和,$O(nlogn ...
- A*算法的认识与求第K短路模板
现在来了解A*算法是什么 现在来解决A*求K短路问题 在一个有权图中,从起点到终点最短的路径成为最短路,第2短的路成为次短路,第3短的路成为第3短路,依此类推,第k短的路成为第k短路.那么,第k短路怎 ...
- Codeforces Round #364 (Div. 2) C
Description Sergei B., the young coach of Pokemons, has found the big house which consists of n flat ...
- chapter07
// 包和引入// 包也可以像内部类那样嵌套// 包路径不是绝对路径// 包声明链x.y.x并不自动 将中间包x和x.y变成可见// 位于文件顶部不带花括号的包声明在整个文件范围内有效// 包对象可以 ...
- spark_20180328
// 2.1 条件表达式val x = 2val s = if (x > 0) 1 else -1if (x > 0) "positive" else -1// 返回值 ...
- 才知道 Windows Live Writer Source Code plugin for SyntaxHighlighter 更新到2.0了
这是我用 Windows Live Writer 发布的第一篇文章! 在官方网站看到 Windows Live Writer Source Code plugin for SyntaxHighligh ...