cyrus 发表于 2018-1-9 21:50:10

自动部署jenkins war包脚本

  ++ 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>
  tomcat-wap.sh: line 11: kill: aux: arguments must be process or job>
  tomcat-wap.sh: line 11: kill: |grep: arguments must be process or job>
  tomcat-wap.sh: line 11: kill: tomcat-wap|grep: arguments must be process or job>
  tomcat-wap.sh: line 11: kill: -v: arguments must be process or job>
  tomcat-wap.sh: line 11: kill: grep|awk: arguments must be process or job>
  tomcat-wap.sh: line 11: kill: '{print: arguments must be process or job>
  : arguments must be process or job>  报错:解决 kill -9`$TOMCAT_PID`# 加反引号即可
  https://images2017.cnblogs.com/blog/1091170/201711/1091170-20171113181018749-1080566161.png
  报这个错:
  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/
  
页: [1]
查看完整版本: 自动部署jenkins war包脚本