1

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.

3 Answers 3

2

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.

1

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
0

Below is the syntax

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

2
  • 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, 2013 at 11:28
  • You can do this 0 0 1 Mar,Jun * /path/to/script Feb 15, 2013 at 11:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .