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-667315/)

vamsi_k 09-03-2008 11:26 AM

how to run crontab job for every 5 seconds
 
How to schedule a cronjob for every 5 seconds?

Operation system using : cent os

odcheck 09-03-2008 11:31 AM

Quote:


- 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

source: Walt Sullivan


All times are GMT -5. The time now is 11:41 PM.