Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crontab - Run a cronjob quarterly

Tags:

cron

crontab

Can anybody give a pattern on how do i run a cron job on quarterly basis. These include the dates March 31, June 30, September 30, Dec 31.

like image 280
HardCode Avatar asked Feb 14 '14 08:02

HardCode


2 Answers

At 00:00 on day-of-month 1 in every 3rd month

0 0 1 */3 *

from https://crontab.guru/every-quarter

like image 178
Cal Smith Avatar answered Sep 27 '22 17:09

Cal Smith


The simplest solution here would be to have two entries in your crontab--one for the 30s and another for the 31s, e.g.:

 0 0 30 6,9 * /path/to/your/script
 0 0 31 3,12 * /path/to/your/script
like image 31
Michael C. O'Connor Avatar answered Sep 27 '22 17:09

Michael C. O'Connor