Cron: Every Weeknight
0 18 * * 1-5 fires at 6 PM, Monday through Friday — a 'weeknight' schedule that explicitly skips weekends. It's a natural fit for end-of-workday automation: nightly builds that shouldn't run on weekends, evening digest emails for a work context, or maintenance windows tied to when an office actually empties out.
0 18 * * 1-5
Examples & Variations
Common Mistakes
- Confusing 'every weeknight' with 'every weekday' — weeknight implies evening hours specifically, not just Monday–Friday at any time; the hour field still needs to reflect an evening time.
- Assuming weeknight automation should skip weekends because 'nobody's working' — verify this is actually true for your system; some workloads (consumer apps, global teams) don't follow a Monday–Friday office rhythm at all.
- Scheduling something at exactly 6 PM without accounting for people who are still finishing up — a slightly later time (7–8 PM) often avoids interrupting anyone still active.
Best Practices
- Good fit for nightly builds, weeknight-only reports, or maintenance windows explicitly tied to an office-hours business rhythm.
- If the exact hour matters for avoiding active users, err later in the evening (9–11 PM) rather than right at typical office close time.
- Document why weekends are excluded — a future engineer debugging a 'missing Saturday run' should be able to see it's intentional, not a bug.
Frequently Asked Questions
- What's the difference between 'every weeknight' and 'every weekday'?
- Every weekday (0 0 * * 1-5, for example) can fire at any hour, including morning. Every weeknight specifically implies an evening hour — the day-of-week range (1-5) is the same, but the hour field should reflect evening, not just any weekday time.
- Does 0 18 * * 1-5 run on public holidays that fall on a weekday?
- Yes — cron has no concept of holidays, only day-of-week. A weekday holiday still counts as a weekday and the job will still fire unless your script itself checks a holiday calendar.
- How do I run something every hour throughout weeknight evenings?
- Combine an hour range with the weekday restriction: 0 19-23 * * 1-5 fires every hour from 7 PM to 11 PM, Monday through Friday.
Related Tools
Cron Parser
Translate cron expressions to plain English
Cron Cheat Sheet
Quick reference for cron syntax, special characters, and shortcuts
Cron Examples Library
Browse and search common cron expression examples
Cron: Twice Daily
Run a cron job twice a day with 0 8,20 * * * or similar — see common AM/PM patterns, examples, and best practices for twice-daily schedules.
Cron: Every Other Day
Standard cron can't natively express 'every other day' across month boundaries. See the common day-of-month workaround, its limitations, and alternatives.
Cron: Every 20 Minutes
The cron expression for every 20 minutes is */20 * * * *, firing at :00, :20, and :40 — a true evenly-spaced interval. See examples and best practices.