hello friends,
I want to shell script to monitor the process.
I want to check the timestamp of log ,if its not updating from 10 min then script will kill that process and restart.
log name is -log_party.20100510
process name is log_part1.sh
script is :-
monitor.sh
DATE1=`date +%Y%m%d`
cd log_path
find . -name "log_party.$DATE1" -mmin +10`
if [ $? -eq 0]
then
ps -eaF| grep 'log_part1.sh'| grep -v grep | awk '{ print $2 }' | xargs kill -9
nohup ./'log_part1.sh'
else
echo "log.party 1 is running "
fi
above script is always taking the status 0 for find command.
any help will be appreciated.!!!!!!!!!