Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Closed Thread
  Search this Thread
Old 09-03-2008, 11:29 AM   #1
Registered: Aug 2008
Posts: 66

Rep: Reputation: 18
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
Old 09-03-2008, 11:35 AM   #2
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Source: Walt Sullivan

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
while [ true ]; do
sleep 1
if [ -z "`ps ax | grep <proc> | grep -v grep`"]; then
#start daemon
Old 09-03-2008, 02:08 PM   #3
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
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.

Closed Thread

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run crontab job for every 5 seconds vamsi_k Linux - Newbie 1 09-03-2008 11:31 AM
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 > Forums > Linux Forums > Linux - Newbie

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

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