- 论坛徽章:
- 0
|
本来是一个很简易的脚本,放在crontan 里执行
30 8 * * * su - oracle -c /home/oracle/apache-tomcat-6.0.14/bin/restart.sh
restart.sh内容:
#!/bin/bash
source /etc/profile
source /home/oracle/.bash_profile
cd /home/oracle/apache-tomcat-6.0.14/bin
nohup ps -ef|grep apache|grep -v httpd|grep -v grep|awk '{print $2}'|xargs kill -9 &
echo "Tomcat restart: ">>restart.log
date >>restart.log
./startup.sh
环境变量什么的,都导进去了。脚本的作用是每天定时 kill 掉一个进程,然后重启这个。
现在的问题是 一个星期当中,有时候会有一两次:进程能kill掉,但是不能重启。
其他时候都是正常的。
请各路大侠帮忙看下,我要如何去追踪发生的问题到底出在哪儿 ? |
|