Cron

Cron for the Last Friday of the Month

Cron has no "last occurrence" concept — this runs every Friday, and the script itself decides whether to actually do anything.

0 9 * * 5

Standard cron syntax can't express "the last Friday of the month" directly — there's no field for counting which occurrence of a weekday you're on. The practical fix is to schedule the job every Friday with 0 9 * * 5, and have the script check, right at the start, whether adding 7 days would push the date into the next month. If it would, it's the last Friday, and the script proceeds; otherwise it exits immediately.

This same every-Friday-plus-check pattern is the standard way to handle any "last [weekday] of the month" requirement — the cron expression never changes, only the day-of-week number inside it and the check in the script.

Want to build a different schedule, or check how a related expression behaves? Open this exact expression in the full Cron Expression Builder to edit it directly.

Related

Related