What does

2 * * * *

means in crontab context?

I want to run my program every 2 minutes; is that what 2 * * * * means?

link|improve this question

20% accept rate
feedback

migrated from stackoverflow.com Feb 11 '10 at 7:05

This question came from our site for professional and enthusiast programmers.

1 Answer

Not quite; that means every 2nd minute of the hour (i.e., 6:02, 7:02, 8:02, etc.). To make it every 2 minutes, use */2 in the first entry:

*/2 * * * * my-script.sh

You can read more about the crontab syntax and available options here at Wikipedia. Ubuntu's got a good overview too.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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