LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 09-03-2008, 11:26 AM   #1
vamsi_k
Member
 
Registered: Aug 2008
Posts: 66

Rep: Reputation: 18
how to run crontab job for every 5 seconds


How to schedule a cronjob for every 5 seconds?

Operation system using : cent os
 
Old 09-03-2008, 11:31 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 977

Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the crontab job is not run ust Linux - Software 1 03-24-2008 07:03 PM
how to run crontab job every 30 seconds houssamfarag Slackware 5 06-23-2006 02:45 AM
how to run crontab job every 20 seconds houssamfarag Mandriva 4 06-23-2006 02:45 AM


All times are GMT -5. The time now is 05:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration