码迷,mamicode.com
首页 > 其他好文 > 详细

自动部署jenkins war包脚本

时间:2017-11-13 19:59:55      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:targe   war包   ``   http   ima   tar   logs   变量   proc   

++ date +%Y%m%d-%H%M
+ BAK_DIR=$‘/home/zcq/backup/20171113-1715\r‘
‘ ‘]‘ -n ‘ps aux |grep tomcat-wap|grep -v grep|awk ‘\‘‘{print }‘\‘‘
‘ kill -9 ps aux ‘|grep‘ ‘tomcat-wap|grep‘ -v ‘grep|awk‘ ‘‘\‘‘{print‘ ‘}‘\‘‘
tomcat-wap.sh: line 11: kill: ps: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: aux: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: |grep: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: tomcat-wap|grep: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: -v: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: grep|awk: arguments must be process or job IDs
tomcat-wap.sh: line 11: kill: ‘{print: arguments must be process or job IDs
: arguments must be process or job IDs

报错:解决 kill -9 `$TOMCAT_PID`# 加反引号即可

技术分享

 

报这个错:

TOMCAT_PID=`ps aux |grep tomcat-wap|grep -v grep|awk ‘{print $2}‘`用反引号引起来截取的进程号

反单引号``,把命令的结果赋给变量

实时更新Apache下的war包,yes |  cp /root/.jenkins/workspace/wap/target/fuqin-wap.war /var/www/html/download/

 

自动部署jenkins war包脚本

标签:targe   war包   ``   http   ima   tar   logs   变量   proc   

原文地址:http://www.cnblogs.com/renliping/p/7827602.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!