1l先准备一个脚本

#!/bin/sh

#./etc/profile

export JAVA_HOME=/usr/java/jdk1.6.0_45

sh /home/tomcat-bingchuang/bin/shutdown.sh

sleep 60s

sh /home/tomcat-bingchuang/bin/startup.sh

2放置到如上/home/ tomcat-bingchuang/bin/目录下

赋予777权限

并在linux里面设置文件格式set ff=unix

3crontab -e

07 01 * * * /home/tomcat-bingchuang/bin/restart_tomcat.sh

设置每天一点零七重启脚本

也就是一点零八启动服务,测试成功

linux篇-linux 下tomcat服务每天定时启动_tomcat