I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if [ $? -eq 0 ]
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h #start process in background
proc_status=$?
if [ $proc_status -eq 0 ]
then
echo "Restarted Process at `date '+%Y-%m-%d %H:%M:%S'` "
fi
fi
crontab entry for this script
*/5 * * * * /home/Ketan_r/logs/sleep_time.sh >> /home/Ketan_r /logs/status_snmp_$(date +\%Y\%m\%d).log
now I want this script also kill and restart �snmp_trap.sh� at 11.30PM every day. I am confused, if I am use sleep to within this to kill process(sleep �time�) then it works but this script run on every 5th minute so it again execute sleep command every 5th minute and go on�..
could you please let me know what could be the possible implementation for this�.