Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
2 * * * *
means in crontab context?
I want to run my program every 2 minutes; is that what 2 * * * * means?
This question came from our site for professional and enthusiast programmers.
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.
Required, but never shown
9 years, 3 months ago
2 years, 4 months ago