Cron on the Second Friday of Every Month
Schedule a cron job on the second Friday of each month with 0 17 8-14 * 5. Field breakdown explaining nth-weekday-of-month scheduling patterns.
Cron Expression
0 17 8-14 * 5
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | 17 | At 17 |
| Day of Month | 8-14 | From 8 to 14 |
| Month | * | Every month (1–12) |
| Day of Week | 5 | At Friday |
Detailed Explanation
The cron expression 0 17 8-14 * 5 is intended to schedule a task at 5:00 PM on the second Friday of every month by targeting Fridays within the 8th through 14th day range.
Field-by-field breakdown:
0(Minute): At minute 0. The task fires at the top of the hour.17(Hour): At hour 17 (5 PM). The task runs at the end of the business day.8-14(Day of Month): Days 8 through 14. The second week of the month always falls within this range, so the second Friday is guaranteed to be one of these days.*(Month): Every month from January through December. No restriction on which month.5(Day of Week): Friday only. The value 5 represents Friday in standard cron.
Important note: As with the first-Monday pattern, standard cron uses OR logic when both Day of Month and Day of Week are specified. This expression will run on ALL Fridays AND on days 8-14 regardless of day of week. To truly target only the second Friday, use 0 17 * * 5 and add a script check: [ "$(date +\%d)" -ge 8 ] && [ "$(date +\%d)" -le 14 ] && your_command. Alternatively, use a more sophisticated scheduler that supports nth-weekday syntax. The 5 PM timing captures the full business day's activity. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Great for triggering bi-monthly payroll processing on the second Friday of every month, ensuring all timesheets from the first two weeks are captured.
Try It — Interactive Builder
at min 0, at hour 17, on day 8-14, on DOW 5
Next 10 Executions
Ctrl+Shift+C to copy expression