Hi,
I setup a cronjob recently on RH AS3 to check if my application is running every minute. But whenever I issue ps -e, I can see something like:
16898 ? 00:00:00 checkmon <defunct>
my crontab file is as below:
* * * * * /servicemon/checkmon
and checkmon is just a simple script:
##########################
#!/bin/sh
isRunning=`ps -e | grep -v grep | grep servicemon`
if [ "X${isRunning}" = "X" ]; then
cd /servicemon
./servicemon & > /dev/null
fi
exit 0
##########################
Would that be a problem or just an expected behaviour in linux? But I don't have this with Solaris.
And another question, how can I run cron job for every few seconds?
Thanks!
- Jiang -
I setup a cronjob recently on RH AS3 to check if my application is running every minute. But whenever I issue ps -e, I can see something like:
16898 ? 00:00:00 checkmon <defunct>
my crontab file is as below:
* * * * * /servicemon/checkmon
and checkmon is just a simple script:
##########################
#!/bin/sh
isRunning=`ps -e | grep -v grep | grep servicemon`
if [ "X${isRunning}" = "X" ]; then
cd /servicemon
./servicemon & > /dev/null
fi
exit 0
##########################
Would that be a problem or just an expected behaviour in linux? But I don't have this with Solaris.
And another question, how can I run cron job for every few seconds?
Thanks!
- Jiang -