Cron Expression Builder
Build and validate cron expressions visually — minute, hour, day, month, weekday fields with human-readable preview.
0 9 * * 1Every Monday, at 9:00 AM
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | 0–59 |
| Hour | 9 | 0–23 |
| Day of month | * | 1–31 |
| Month | * | 1–12 |
| Day of week | 1 | 0 = Sun, 6 = Sat |
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
- กรอกแต่ละห้าฟิลด์ ทิ้ง * ไว้สำหรับ "ทุกๆ"
- ดู expression ที่ประกอบขึ้นและตัวอย่างที่อ่านได้อัปเดตแบบ real-time
- ใช้ปุ่ม preset เพื่อเริ่มจากกำหนดการทั่วไป
- คลิก Copy เพื่อคัดลอก expression ไปยัง clipboard
- วางลงใน 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.
เครื่องมือที่เกี่ยวข้อง
- JSON Formatter, Validator & Repair Tool
Format, minify, validate, and repair JSON instantly in your browser. Sort keys alphabetically, auto-format on paste, download as file, escape/unescape strings — free, no sign-up, 100% client-side.
- ตัวสร้าง QR Code
สร้าง QR code สำหรับ URL ข้อความ Wi-Fi และอื่นๆ ดาวน์โหลดเป็น PNG
- ตัวสร้างรหัสผ่าน
สร้างรหัสผ่านสุ่มที่แข็งแกร่งด้วยความยาวและชุดอักขระที่กำหนดเอง
- Base64 เข้ารหัส / ถอดรหัส
เข้ารหัสข้อความเป็น Base64 หรือถอดรหัสกลับเป็นข้อความธรรมดา
- URL เข้ารหัส / ถอดรหัส
เข้ารหัสหรือถอดรหัส URL และ query strings ด้วย percent-encoding