Say you want to run a job every 30 minutes on linux (or osx) using crontab. Sometimes I see the the sytax written like this:

30 * * * * /path/to/job

and sometimes I see it written like

*/30 * * * * /path/to/job

Are those two lines equivalent? (They seem to be based on my tests). Are there any differences?

link|improve this question

64% accept rate
feedback

1 Answer

up vote 1 down vote accepted

They shouldn't behave identically. The first line tells crontab to execute the job 30 minutes past every hour (i.e. 5:30, 6:30, 7:30 ...), while the second line tells crontab to execute the job every 30 minutes (i.e. 5:00, 5:30, 6:00, 6:30 ...)

You can check the crontab man page for detailed instructions.

link|improve this answer
Great, thanks!!! – evan Nov 18 '10 at 22:22
When you say */30 runs the job every thirty minutes, that means from the time you finish editing the crontab file - or always on the hour and on the half hour? – evan Nov 18 '10 at 22:25
@evan: On the hour and half hour. – Dennis Williamson Nov 19 '10 at 3:12
feedback

Your Answer

 
or
required, but never shown

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