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 would like to schedule my tasks every x months on day 1 starting for example, March. I am unsure if this is the syntax I'm looking for (for repeating the job every 4 months):

0 0 1 3/4 * /path/to/file

The man page for crontab does not explain in detail how the steps (/) work.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

You have it correct in your comment to Abhishek's answer.

0 0 1 3,7,11 * /path/to/file

In this case the "/" won't do what you're after.

share|improve this answer
add comment

Just for completeness, it seems that you originally wanted to do this:

0 0 1 3-12/4 * /path/to/file

Just like with the other fields, if you want a month range, you have to specify both the start and the finish, separated by a dash. For every odd-numbered month, for example, you can use:

0 0 1 1-12/2 * /path/to/file
share|improve this answer
add comment

Below is the syntax

0 0 1 */4 * /path/to/file

share|improve this answer
    
That will not work if I want to repeat every 4 months starting March. */4 => 1,5,9, what I was wondering is if it is possible for it to expand to => 3,7,11 –  Octav O Feb 15 '13 at 11:28
    
You can do this 0 0 1 Mar,Jun * /path/to/script –  Abhishek Anand Amralkar Feb 15 '13 at 11:34
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.