Đi tới nội dung

Đọc biểu thức cron

Giải nghĩa biểu thức cron và xem các lần chạy tiếp theo theo múi giờ của bạn.

Chạy cục bộ trên trình duyệt

// human readable

At 09:00, Monday to Friday.

0
minute
9
hour
*
day of month
*
month
1-5
day of week
// next 5 runs

Working it out.

Want to know why a schedule behaves the way it does? The cron expression simulator runs the same engine with the traps laid out: uneven steps, the two day fields, and what daylight saving does to a job in the small hours.

Cách hoạt động

Cron syntax cheat sheet

Five fields, in order

* * * * *
┬ ┬ ┬ ┬ ┬
│ │ │ │ └─ day of week (0-7, Sun=0 and 7)
│ │ │ └─── month (1-12)
│ │ └───── day of month (1-31)
│ └─────── hour (0-23)
└───────── minute (0-59)

Operators

  • * any value
  • , list of values, e.g. 1,15,30
  • - range, e.g. 1-5
  • / step, e.g. */15 every 15
  • Names work too: JAN-DEC and SUN-SAT

The one that catches everyone

When both the day-of-month and day-of-week fields are set, cron combines them with or, not and. 0 9 1 * MON runs on the 1st of the month and on every Monday, not only on Mondays that fall on the 1st. A monthly job written that way quietly runs weekly. If only one of the two is set, it behaves as you would expect.

Shortcuts

  • @yearly / @annually: 0 0 1 1 *
  • @monthly: 0 0 1 * *
  • @weekly: 0 0 * * 0
  • @daily / @midnight: 0 0 * * *
  • @hourly: 0 * * * *

Câu hỏi thường gặp

What does * * * * * mean?

Every minute of every hour of every day. The five fields are minute, hour, day-of-month, month, day-of-week. An asterisk in any field means "any value".

How do I run a job every 15 minutes?

Use `*/15 * * * *`. The slash introduces a step value; `*/15` means every 15 minutes starting at minute 0.

What timezone do the next run times use?

Your local timezone, as reported by the browser. If your server runs cron in UTC, remember to adjust before scheduling.

Are @daily and 0 0 * * * the same?

Yes. `@daily` and `@midnight` are shortcuts for `0 0 * * *`. This parser expands them automatically when computing the next run times.

Các công cụ được port từ DevOps Daily theo giấy phép MIT.Xem bản gốc

Công cụ khác

Chuyển đổi Unix timestamp

Epoch sang ngày giờ và ngược lại. UTC, giờ địa phương, ISO 8601 và thời gian tương đối.

Mở công cụ

Tính subnet CIDR

Phân tích dải CIDR, tính dải địa chỉ, chia nhỏ subnet và kiểm tra một IP có nằm trong mạng hay không.

Mở công cụ

Giải mã JWT

Xem nội dung bất kỳ JWT nào ngay trên trình duyệt. Không gửi gì lên server.

Mở công cụ