simple tomcat toolITeyetengxun - 众发娱乐

simple tomcat toolITeyetengxun

2019-02-02 07:05:33 | 作者: 起运 | 标签: 文件,进程,修正 | 浏览: 7521

/usr/local/mysql/bin/mysqldump -u root -pmysqladmin all-databases | gzip -9 "/data/backup/$(date +"%Y%m%d").sql.gz" echo $(date +"%Y-%m-%d %H:%M:%S") backup end

 

 

0.simple tomcat sh:

 

 

ps -ef | awk /tomcat/{print "kill " $2} | sh 

 

语法:awk /正则表达式/{print }

 

ps -ef | grep java | awk {print "kill "$2} | sh

 

 

1.这个是修正后的文件,比起之前那个简略了一点,不必生成中心文件。

 

 

 

excu=`ps -ef | grep tomcat | awk {print $2}`
kill $excu;
#start the tomcat server
if [ $1 ]; then
sh pageapi/tomcat/bin/startup.sh

 

 

2.增加usage和指令挑选的

ACTION=$1
usage()
 echo "Usage arg : stop | start | restart";
stop()
 excu=`ps -ef | grep tomcat | awk {print $2}`
 kill $excu;
start()
 sh pageapi/tomcat/bin/startup.sh
case "$ACTION" in
 stop)
 stop
 start)
 start
 restart)
 stop
 start
 usage
esac

 

 

 

 

 

 

 

3.开始的文件,生成中心文件 

 

每次都ps -ef | grep tomcat太累啦~~~~

 

1.tomcatutil.sh脚本:履行后删去tomcat进程

#delete tomcat process
ps -ef | grep tomcat | awk {print "kill "$2} kill2.sh
chmod +x kill2.sh
sh kill2.sh
#if the arg is not null ;start the tomcat server
if [ $1 ]; then
sh pageapi/tomcat/bin/startup.sh

 

2.假如期望重启,随意给一个参数,就重启啦:

tomcatutil.sh start

 

 

-

-

-

-

测验项目发布在tomcat上,不是jboss,每次都ps -ef | grep tomcat太累啦~~~~

tomcatutil.sh脚本:履行后删去tomcat进程

 #delete tomcat process                                           
ps -ef | grep tomcat | awk {print "kill "$2} kill2.sh     
chmod +x kill2.sh                                                     
sh kill2.sh                                                                 rm kill2.sh                                                                                                                                                #if the arg is not null ;start the tomcat server               
if [ $1 ]; then                                                             
sh pageapi/tomcat/bin/startup.sh                               
fi                                                                             
ps -ef  输出process grep tomcat 输出tomcat进程,与同布置一同的jboss无关 awk {print "kill "$2} 将进程号输出 kill2.sh  保存到文件 chmod +x kill2.sh 增加履行操作 if [ $1 ]; then 假如有参数 sh pageapi/tomcat/bin/start.sh 履行相对路径的start demo: ./tomcatutil.sh 杀掉tomcat,然后能够布置新机器 ./tomcatutil.sh aaaa 随意一个参数就重启~~偷闲行为~~~ tomcat 6 下敞开长途调试: linux下修正catalina.sh:
JAVA_HOME=/usr/local/jdk1.6
if [ "$1" = "start" ] ; then
 rm -Rf ../work/Catalina
 JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Xms256m -Xmx512m -XX:PermSize=64m -XX:M
axPermSize=256m -XX:+PrintGCDetails -Xloggc:../logs/gc$$.log -XX:+HeapDumpOnOutOfMemoryError "
window下修正startup.bat:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
java发动指令
#!/bin/bash                          
			
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表众发娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章