LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to run crontab job for every 5 seconds (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-crontab-job-for-every-5-seconds-667316/)

vamsi_k 09-03-2008 11:29 AM

how to run crontab job for every 5 seconds
 
what are the steps to schedule crontab job for every 5 seconds?

O.S : cent OS

odcheck 09-03-2008 11:35 AM

Source: Walt Sullivan

Quote:

Special thanks to Walt Sullivan who send a detailed script to restart a
dying daemon.

- cron's granularity is in minutes, it would be a little silly for
cron to wake up every second and cron is not really designed for such
frequent runs.
- Just write a loop-forever script and 'sleep 1' at the bottom of the
loop.
while [ true ]; do
sleep 1
if [ -z "`ps ax | grep <proc> | grep -v grep`"]; then
#start daemon
fi
Done

Tinkster 09-03-2008 02:08 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...econds-667315/


All times are GMT -5. The time now is 04:05 PM.