Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

CentOS 6

I have a shell script that performs a task every minute. The task itself only takes a couple seconds to complete and ideally I'd like to have this shell script execute 2-3 times per minute. Is that possible to do with cron? Or is the fastest interval once every 60 seconds?

share|improve this question
have you tried , which posted ? – Rahul Patil Mar 18 '13 at 8:00

It's simple just use below syntax in cron

it will run if first run successfully then other and so on

* * * * *  /path/of/yoursript.sh && sleep 5s && /path/of/yoursript.sh && sleep 5s && /path/of/yoursript.sh 
share|improve this answer

cron's manpage says that

cron(8) examines cron entries once every minute.

so its resolution is 60 seconds by design. You could have a cron job that calls the script more than once, but you'll have to be careful that the jobs don't start overlapping each other in case the script takes longer than expected.

If you really need (say) execution every 30 seconds, you'd be better off wrapping your script in a loop and daemonising it. You'll have to write your own error handling, as you won't be able to rely on cron emailing you errors any more.

share|improve this answer

Just an add-on for Rahul Patil answer. Using his answer, I have achieved the required result the following way:

* * * * *  /path/of/myscript.sh
* * * * *  sleep 20s && /path/of/myscript.sh
* * * * *  sleep 40s && /path/of/myscript.sh

This allowed me to execute the script 3 times per minute.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.