如何在Linux操作系统定时重启Tomcat服务
展开全部
Linux操作系统定时重启Tomcat服务的方法如下:
1、编写tomcat_shutdown.sh:
#!/bin/sh
export JAVA_HOME=/home/oracle/jdk1.7.0_67/
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
echo “========begin stop the tomcat========”
‘/home/oracle/apache-tomcat-7.0.29/bin/shutdown.sh’
2、编写tomcat_startup.sh:
#!/bin/sh
export JAVA_HOME=/home/oracle/jdk1.7.0_67/
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
echo “========begin start the tomcat========”
‘/home/oracle/apache-tomcat-7.0.29/bin/startup.sh’
3、在linux系统终端中,输入命令“crontab -e”:
1、编写tomcat_shutdown.sh:
#!/bin/sh
export JAVA_HOME=/home/oracle/jdk1.7.0_67/
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
echo “========begin stop the tomcat========”
‘/home/oracle/apache-tomcat-7.0.29/bin/shutdown.sh’
2、编写tomcat_startup.sh:
#!/bin/sh
export JAVA_HOME=/home/oracle/jdk1.7.0_67/
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
echo “========begin start the tomcat========”
‘/home/oracle/apache-tomcat-7.0.29/bin/startup.sh’
3、在linux系统终端中,输入命令“crontab -e”:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询