Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run cron job on 29th of every month? [closed]

Tags:

cron

Is it possible to write a single cron expression which runs on the 29th day of every month OR the last day if the month has only 28 days (e.g. February)?

like image 454
Keyur Ardeshana Avatar asked Sep 20 '25 14:09

Keyur Ardeshana


1 Answers

Single cron syntax is not possible. You can do last day of the month

0 0 12 L 1/1 ? *. 

It will trigger last day of every month.

0 0 12 29 1/1 ? *.

If you trigger like this you will miss non leap year February.

like image 184
Siva Kumar Avatar answered Sep 23 '25 10:09

Siva Kumar