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.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
Octav O
  • 113
  • 2

3 Answers3

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.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
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
chutz
  • 7,888
  • 1
  • 29
  • 59
0

Below is the syntax

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