autoRelease.sh

#!/bin/sh
/home/tomcat/bin/shutdown.sh
echo "tomcat stoped"
cd /home/tomcat/webapps
rm -rf DETECT-X/ DETECT-X.war
wget http://192.168.1.42/DETECT-X.war
/home/tomcat/bin/startup.sh

war包可以放在支持web访问的地方,比如 tomcat、hfs

 

 

cron 定时任务

[root@localhost tmp]# crontab -e //这里是编辑
crontab: no changes made to crontab
[root@localhost tmp]# crontab -l //查看
32 16 11 3 * /bin/sh /root/tmp/autoRelease.sh >/dev/null 2>&1

command 后面必须加 >/dev/null 2>&1

 

注意系统时间:

[root@localhost tmp]# date
Mon Mar 11 16:32:00 CST 2019
[root@localhost tmp]# date
Mon Mar 11 16:32:01 CST 2019
[root@localhost tmp]# crontab -l
32 16 11 3 * /bin/sh /root/tmp/autoRelease.sh >/dev/null 2>&1

 

 

参考:

https://blog.51cto.com/oldboy/1410555

https://www.cnblogs.com/lcrbg/p/5549777.html

https://www.cnblogs.com/ihuangjianxin/p/7837193.html

 

相关文章:

  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-12-11
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2023-03-14
  • 2021-05-31
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案