參考 最近更新: 2026-11-23
Cron 排程語法速查表
可即時搜尋的 5 欄位 Cron 運算式參考,收錄 POSIX 巨集、步進間隔、時段區間與每週/每月排程範本。
| Expression | Human Schedule | Category | Notes |
|---|---|---|---|
| * * * * * | Every minute | Frequent | Runs 1,440 times per day; avoid heavy jobs without locking |
| */2 * * * * | Every 2 minutes | Frequent | Step value divides 0-59 minutes evenly (0, 2, 4, ... 58) |
| */5 * * * * | Every 5 minutes | Frequent | Popular polling and health-check interval |
| */10 * * * * | Every 10 minutes | Frequent | Executes at :00, :10, :20, :30, :40, and :50 |
| */15 * * * * | Every 15 minutes | Frequent | Equivalent to 0,15,30,45 * * * * |
| */30 * * * * | Every 30 minutes | Frequent | Executes at :00 and :30 of every hour |
| 5,35 * * * * | Twice per hour at :05 and :35 | Hourly | Staggered offset avoids top-of-hour traffic spikes |
| 0 * * * * | Every hour on the hour | Hourly | Equivalent to the @hourly macro |
| 17 * * * * | Every hour at minute 17 | Hourly | Prime minute offset reduces thundering-herd load |
| 0 */2 * * * | Every 2 hours | Hourly | Runs at 00:00, 02:00, 04:00 ... 22:00 |
| 0 */4 * * * | Every 4 hours | Hourly | 6 executions per day at even 4-hour marks |
| 0 */6 * * * | Every 6 hours | Hourly | Runs at 00:00, 06:00, 12:00, and 18:00 UTC |
| 0 */12 * * * | Twice daily at 00:00 and 12:00 | Daily | Useful for twice-daily database snapshots |
| 0 0 * * * | Every day at midnight (00:00) | Daily | Equivalent to @daily and @midnight |
| 30 2 * * * | Every day at 02:30 | Daily | Common off-peak nightly maintenance window (watch DST in local time) |
| 0 6,18 * * * | Daily at 06:00 and 18:00 | Daily | Comma-separated list in the hour field |
| 0 9-17 * * * | Hourly from 09:00 through 17:00 daily | Daily | Inclusive hour range 9..17 |
| */15 9-17 * * 1-5 | Every 15 minutes during weekday business hours | Business Hours | Monday (1) through Friday (5), 09:00-17:45 |
| 0 9 * * MON-FRI | Weekdays at 09:00 | Business Hours | Named weekday range equivalent to 1-5 |
| 30 18 * * 1-5 | Weekdays at 18:30 | Business Hours | End-of-business-day report or cleanup |
| 0 0 * * 0 | Every Sunday at 00:00 | Weekly | Both 0 and 7 represent Sunday in Vixie cron; equivalent to @weekly |
| 0 3 * * MON | Every Monday at 03:00 | Weekly | Three-letter weekday names are case-insensitive |
| 0 4 * * SAT,SUN | Weekends at 04:00 | Weekly | Runs Saturday and Sunday only |
| 0 1 1 * * | First day of every month at 01:00 | Monthly | Ideal for monthly billing or log rotation |
| 0 0 1,15 * * | 1st and 15th of every month at 00:00 | Monthly | Bi-monthly payroll or invoice sync |
| 0 0 1 */3 * | First day of every quarter at 00:00 | Quarterly | Runs Jan 1, Apr 1, Jul 1, and Oct 1 |
| 0 0 1 JAN * | January 1 at 00:00 (yearly) | Yearly | Equivalent to @yearly and @annually |
| 0 12 29 2 * | Leap day (Feb 29) at 12:00 | Yearly | Executes only in leap years |
| @hourly | Macro: once an hour (0 * * * *) | Macro | Supported by Vixie/GNU cron and most cloud schedulers |
| @daily | Macro: once a day at midnight (0 0 * * *) | Macro | Alias for @midnight |
| @weekly | Macro: once a week on Sunday (0 0 * * 0) | Macro | Runs at 00:00 Sunday |
| @monthly | Macro: once a month on day 1 (0 0 1 * *) | Macro | Runs at 00:00 on the 1st of each month |
| @yearly | Macro: once a year on Jan 1 (0 0 1 1 *) | Macro | Alias for @annually |
| @reboot | Macro: once at system/daemon startup | Macro | Runs on boot in system cron; not supported in stateless cloud cron |
找不到相符的資料列
請嘗試其他關鍵字,或清除篩選顯示全部資料。
相關工具
相關教學
相關參考資料
常見問題
- What do the five fields in a standard POSIX cron expression represent?
- From left to right, the five fields represent minute (0-59), hour (0-23), day of month (1-31), month (1-12 or JAN-DEC), and day of week (0-7 or SUN-SAT, where both 0 and 7 denote Sunday).
- How does standard cron handle when both Day of Month and Day of Week are restricted?
- In standard POSIX/Vixie cron, when both day-of-month and day-of-week are non-wildcard (*), the job runs whenever either condition matches (logical OR), rather than requiring both to match simultaneously.
- What schedules do shorthand cron @macros like @daily and @hourly expand to?
- @hourly equals 0 * * * *, @daily and @midnight equal 0 0 * * *, @weekly equals 0 0 * * 0, @monthly equals 0 0 1 * *, @yearly and @annually equal 0 0 1 1 *, and @reboot runs once at daemon startup.