Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In cron you can specify */n where n means every n times period, for instance in the first column is minute.

*/5 means every 5 minutes, but which minutes? 0, 5, 10, ...?

What happens if the number specified is not a divisor of 60?

*/7 what will happen, will it start to skew in the next hour?
share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

It'll go on 7, 14, ... 56, 0, 7, 14, ...

With that syntax, I like to think of it as going when t mod x === 0

share|improve this answer
    
Thanks this clears my doubt –  stivlo Nov 29 '11 at 4:16
add comment

In crontab, * is a shorthand for first-last (where first is the minimum possible value and last is the maximum possible value).

The syntax first-last/step means "every N where N >= first and N <= last and (N - first) % step == 0".

So */7 in minutes means the same as 0,7,14,21,28,35,42,49,56. But 1-59/7 means 1,8,15,22,29,36,43,50,57.

share|improve this answer
    
So I'm not sure if I understand, Why did you choose 1 for first and not 0? –  stivlo Nov 30 '11 at 4:36
1  
@stivlo, to illustrate the difference between 0-59/7 (a.k.a. */7) and 1-59/7. –  cjm Nov 30 '11 at 5:14
add comment

Your Answer

 
discard

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.