Stax
Tools

Cron Expression Builder

Build and validate cron expressions visually — minute, hour, day, month, weekday fields with human-readable preview.

0–59
0–23
1–31
1–12
0=Sun, 6=Sat
CRON EXPRESSION
0 9 * * 1

Every Monday, at 9:00 AM

FieldValueMeaning
Minute00–59
Hour90–23
Day of month*1–31
Month*1–12
Day of week10 = Sun, 6 = Sat
COMMON PRESETS

cron expression ทำงานอย่างไร

วิธีสร้าง cron expression

รูปแบบ cron ที่ใช้บ่อย

ที่ใช้ cron expression

cron expression มีห้าฟิลด์ อ่านจากซ้ายไปขวา ได้แก่ นาที · ชั่วโมง · วันในเดือน · เดือน · วันในสัปดาห์ แต่ละฟิลด์รับตัวเลข wildcard (*) range (1-5) รายการ (1,3,5) หรือ step (*/15) รวมกันเพื่อแสดงกำหนดการซ้ำๆ เกือบทุกรูปแบบโดยไม่ต้องเขียนโค้ดแม้แต่บรรทัดเดียว

cron expression มีต้นกำเนิดใน Unix แต่ปัจจุบันเป็นมาตรฐานทั่วทั้งอุตสาหกรรม Linux/macOS crontab คือกรณีการใช้งานคลาสสิก แพลตฟอร์ม cloud ใช้รูปแบบ 5 ฟิลด์เดียวกัน ได้แก่ AWS EventBridge (พร้อม syntax ที่ขยายเล็กน้อย), GCP Cloud Scheduler, Azure Logic Apps และ Kubernetes CronJobs ระบบ CI/CD อย่าง GitHub Actions ใช้ syntax cron สำหรับการกำหนดเวลา workflow trigger

วิศวกร DevOps ใช้ตัวสร้างเพื่อสร้าง expression ที่ถูกต้องสำหรับการสำรองข้อมูลฐานข้อมูลทุกคืนที่ต้องทำงานเวลา 2:00 น. ทุกวัน — 0 2 * * * นักพัฒนา backend กำหนดเวลาส่งรายงานรายสัปดาห์ทุกวันจันทร์เวลา 9 โมงเช้า — 0 9 * * 1 — และตรวจสอบตัวอย่างที่อ่านได้ก่อน deploy วิศวกรข้อมูลตั้งค่า ETL pipeline trigger รายชั่วโมงด้วย 0 * * * * และใช้ step syntax */6 * * * * สำหรับงาน polling ที่ถี่ขึ้น SRE กำหนดค่า health-check บน Kubernetes CronJobs และใช้เครื่องมือนี้เพื่อยืนยันว่ากำหนดการทำงานตามเวลาที่คาดหวังก่อน push ไป production

  1. กรอกแต่ละห้าฟิลด์ ทิ้ง * ไว้สำหรับ "ทุกๆ"
  2. ดู expression ที่ประกอบขึ้นและตัวอย่างที่อ่านได้อัปเดตแบบ real-time
  3. ใช้ปุ่ม preset เพื่อเริ่มจากกำหนดการทั่วไป
  4. คลิก Copy เพื่อคัดลอก expression ไปยัง clipboard
  5. วางลงใน cron scheduler (crontab, GitHub Actions, AWS EventBridge ฯลฯ)
  • * * * * * — ทุกนาที
  • 0 * * * * — ต้นของทุกชั่วโมง
  • 0 0 * * * — ทุกวันตอนเที่ยงคืน
  • 0 9 * * 1-5 — ทุกวันทำงานเวลา 9:00 น.
  • 0 0 1 * * — วันแรกของทุกเดือนตอนเที่ยงคืน
  • */15 * * * * — ทุก 15 นาที
  • 0 9,18 * * * — 9 โมงเช้าและ 6 โมงเย็นทุกวัน
  • 0 0 * * 0 — ทุกวันอาทิตย์ตอนเที่ยงคืน

คำถามที่พบบ่อย

What is a cron expression?
A cron expression is a string of five space-separated fields that defines a recurring schedule for automated tasks. It is used in Unix/Linux cron jobs, CI/CD pipelines (GitHub Actions, GitLab CI), and cloud schedulers (AWS EventBridge, GCP Cloud Scheduler, Kubernetes CronJobs) to trigger work at precise times without manual intervention.
What does each field in a cron expression mean?
The five fields are: Minute (0–59), Hour (0–23), Day of Month (1–31), Month (1–12), and Day of Week (0–6, where 0 = Sunday). Example: '0 9 * * 1' means 'at 9:00 AM every Monday'. An asterisk (*) means 'every valid value for that field'.
What do *, /, -, and , mean in cron syntax?
* means 'every' (e.g., * in the minute field = every minute). / means 'step' (*/15 = every 15 units). - defines a range (1-5 in day-of-week = Monday through Friday). , separates a list of values (1,3,5 = Monday, Wednesday, Friday). These can be combined: 1-5/2 means every 2nd day from Monday to Friday.
How do I run a job every 5 minutes?
Set the Minute field to */5 and leave all other fields as *. The full expression is '*/5 * * * *'. This fires at :00, :05, :10, :15, and so on throughout every hour of every day.
What is the difference between Day of Month and Day of Week?
Day of Month (field 3) targets specific calendar dates — e.g., 1 means the 1st of each month. Day of Week (field 5) targets specific weekdays — e.g., 1 means every Monday. When both are non-asterisk, most cron implementations fire when either condition is met (OR logic), not only when both match.
Does this tool run the job or just build the expression?
It only builds the expression string. No jobs are executed. Copy the expression and paste it into your cron scheduler — your Linux crontab, GitHub Actions schedule trigger, AWS EventBridge rule, or whichever platform you use.

เครื่องมือที่เกี่ยวข้อง