Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to schedule a job which starts 6 mins past the hr every hr and then runs every 15 mins. So it kicks off at 10:06 then 10:21, 10:36,10:51. I know one way is : 06,21,36,51 * * * * /bin/foo

However why doesn't something like this work: 06/15 * * * *

share|improve this question
1  
Because no one found it useful enough to write the code and make sure it is unambiguous. Because that's the problem with this: You can try to add all kind of fancy syntaxes for adding times, but they must be easy to understand and precise. –  Sven Aug 11 '10 at 22:06

1 Answer 1

up vote 3 down vote accepted

You actually want it separeted by comma with no space between it, so it takes place in all the minutes you want:

6,21,36,51 * * * * /bin/foo

or you could use it every 15 minutes which would look like this:

6-59/15 * * * * /bin/foo

For more information you can man crontab 5 or check this url http://www.manpagez.com/man/5/crontab/

The 6/15 doesnt work because it doesnt know how to divide it, if you had it like 0-59/15 it could work but then it would not count the initial 6 that you wish for.

The initial number should be a range that will be divided by the number after the / to run every X minutes (where X is the number that comes after the /) within the range you gave it.

another example would be 0-40/5 which would run every 5 minutes until the 40 minutes.

share|improve this answer
    
Would 6-59/15 have the right effect, do you think? –  Slartibartfast Aug 12 '10 at 5:19
    
Yes i belive it would i won't say for certain as i dont make much use of irregular minutes like you want to but in theory yes it should work. –  Prix Aug 12 '10 at 6:04

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.