Cron Parser
Cron式を解析し、人間が読みやすい形式で説明を表示します。次の実行時刻も計算します。
Cron式を入力
形式: 分(0-59) 時(0-23) 日(1-31) 月(1-12) 曜日(0-6, 0=日曜)
プリセット
How to Use the Cron Parser
The Cron Parser is a free online tool that helps you understand and validate cron expressions used in task scheduling systems across Unix, Linux, macOS, and various cloud platforms. Cron expressions define the schedule for automated jobs and are widely used in system administration, DevOps pipelines, CI/CD workflows, and application scheduling. This tool parses standard five-field cron expressions consisting of minute, hour, day of month, month, and day of week fields, and converts them into human-readable descriptions so you can quickly verify your schedule is correct.
Understanding Cron Expression Syntax
A standard cron expression consists of five fields separated by spaces. The minute field accepts values from 0 to 59, the hour field from 0 to 23, the day of month from 1 to 31, the month from 1 to 12, and the day of week from 0 to 6 where 0 represents Sunday. Each field supports several special characters: an asterisk (*) means every possible value, a slash (/) specifies step values (e.g., */5 in the minute field means every 5 minutes), a hyphen (-) defines ranges (e.g., 1-5 means Monday through Friday in the day of week field), and commas (,) separate individual values or ranges in a list.
Common Cron Patterns
Some of the most frequently used cron patterns include: "* * * * *" which runs every minute, "0 * * * *" which runs at the top of every hour, "0 0 * * *" which runs at midnight every day, "0 9 * * 1" which runs every Monday at 9 AM, and "0 0 1 * *" which runs on the first day of every month at midnight. This tool provides preset buttons for these common patterns so you can quickly insert them and see their next execution times. The next execution time calculator shows the upcoming five scheduled runs based on your current local time, making it easy to verify that your cron job will fire exactly when you expect.
Use Cases for Cron Scheduling
Cron scheduling is essential for automating repetitive tasks such as database backups, log rotation, sending scheduled emails or reports, cleaning temporary files, syncing data between systems, running health checks, deploying updates, and triggering CI/CD pipelines. Cloud platforms like AWS (CloudWatch Events), Google Cloud (Cloud Scheduler), and Azure (Timer Triggers) all use cron-like syntax for scheduling serverless functions and workflows. Understanding cron expressions is a fundamental skill for developers, system administrators, and DevOps engineers working with automated task scheduling.
Cron Parserの使い方
このCron Parserは、Unix/Linuxやクラウドプラットフォームでのタスクスケジューリングに使用される cron式を解析・検証するための無料オンラインツールです。5つのフィールド(分、時、日、月、曜日) からなる標準的なcron式を解析し、日本語で分かりやすく説明します。また、次の5回の実行時刻を 計算して表示するため、スケジュールが正しいかすぐに確認できます。全ての処理はブラウザ内で 完結するため、データがサーバーに送信されることはありません。
実務での活用例
1. 深夜バッチをcrontabに登録する前の最終確認
DBバックアップやログローテーションを「0 3 * * *」のような式でサーバーに登録する場面では、 書き間違い1文字が大きな事故につながります。「毎日3時」のつもりが「3分ごと」(*/3)になっていた、 というのは典型的な失敗例です。登録前に本ツールへ式を貼り、「3時0分に実行」という日本語の説明と 次の5回の実行時刻を目視確認してから crontab -e で反映すれば、 「翌朝になってもジョブが動いていなかった」「夜中にジョブが暴走していた」という事態を防げます。
2. GitHub Actionsのscheduleトリガー検証(UTCの罠)
GitHub Actionsの on.schedule はUTCで評価されます。日本時間の朝9時にワークフローを 動かしたい場合、「0 9 * * *」と書くと実際にはJST 18時に実行されてしまいます。正しくは9時間引いた 「0 0 * * *」です。本ツールはブラウザのローカルタイムゾーン(日本ならJST)で次回実行時刻を計算するため、 UTC基準のサービスに貼る式は時差を補正したうえで「補正後の式が意図どおり展開されるか」の検証に使ってください。
3. 営業時間内だけ動かす監視ジョブの設計
「*/5 9-18 * * 1-5」のようにステップ(*/5)・範囲(9-18)・曜日(1-5)を組み合わせると、 平日の9時〜18時台に5分間隔で実行する監視ジョブを1行で表現できます。 ただし特殊文字を複数組み合わせた式は読み違えやすいため、次回実行時刻の一覧で 「土日に動いていないか」「19時以降に動いていないか」を確認してから採用するのが確実です。
よくあるエラーと対処 / Common Errors and Fixes
cron式は実装ごとの方言が多く、「文法としては正しいのに意図と違う時刻に動く」失敗が大半を占めます。 本ツールで実際に表示されるエラーと、登録先のサービスで起こりがちな落とし穴をまとめました。
Cron has many dialects. Most failures are expressions that are syntactically valid but fire at the wrong time. Here are the errors this tool reports, plus pitfalls common in real schedulers.
| エラー・症状 / Error or Symptom | 原因 / Cause | 対処 / Fix |
|---|---|---|
| 「Cron式は5つのフィールドが必要です」 "A cron expression needs 5 fields" | Quartz/Spring形式(秒付き6-7フィールド)を貼った Pasted a Quartz/Spring expression (6-7 fields with seconds) | 先頭の秒フィールドを削除して5フィールドにする Drop the leading seconds field to get 5 fields |
| 「無効な曜日フィールド: 7」 "Invalid day-of-week field: 7" | 日曜を7と記述。crontabは0と7の両方が日曜だが、0-6のみの実装も多い Sunday written as 7; crontab accepts 0 and 7, but many parsers only accept 0-6 | 日曜は0で書くのが最も互換性が高い Write Sunday as 0 for maximum compatibility |
*/15 が「毎時15分」に動かない*/15 does not fire at quarter past each hour | */n はステップ値(n分ごと)の意味*/n means "every n units," not "at minute n" | 毎時15分は 15 * * * *、15分ごとは */15 * * * *Use 15 * * * * for :15 each hour; */15 * * * * for every 15 min |
| 実行時刻が9時間ずれる Jobs run 9 hours off | GitHub ActionsやCloud SchedulerはUTC基準 GitHub Actions and Cloud Scheduler default to UTC | JSTの目標時刻から9時間引く(JST 9:00 → 0 0 * * *)Subtract 9 hours from JST (9:00 JST → 0 0 * * *) |
0 0 1 * 1 が毎月1日の月曜以外でも動く0 0 1 * 1 fires on days that are not Monday the 1st | POSIX cronでは日(1-31)と曜日の同時指定はOR条件 In POSIX cron, day-of-month and day-of-week combine with OR | どちらかを * にするか、スクリプト側で日付チェックLeave one as *, or check the date inside the script |
| 「無効な分フィールド: 60」 "Invalid minute field: 60" | 分は0-59、時は0-23。24:00という表記は存在しない Minutes are 0-59, hours 0-23; there is no 24:00 | 深夜0時は 0 0 * * * と書くWrite midnight as 0 0 * * * |
JAN や MON が解析できないJAN / MON names are rejected | 月名・曜日名の英略称は一部実装のみの拡張 Name abbreviations are an extension, not universally supported | 数値(月1-12 / 曜日0-6)に置き換える Replace with numbers (months 1-12, weekdays 0-6) |
@daily が解析できない@daily is rejected | @reboot / @daily 等はcrontab拡張のニックネームで5フィールド式ではない@reboot, @daily, etc. are crontab nicknames, not 5-field expressions | @daily → 0 0 * * *、@hourly → 0 * * * * に展開Expand @daily to 0 0 * * *, @hourly to 0 * * * * |
言語別コード例 / Code Examples by Language
検証したcron式を実際のスケジューラに登録する際の最小サンプルです。
Minimal snippets for registering a validated cron expression in real schedulers.
Shell (crontab)
# crontabを編集 / Edit your crontab
crontab -e
# 毎日3:00にバックアップ / Daily backup at 03:00
0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
# 登録内容を確認 / List current entries
crontab -lJavaScript (node-cron)
import cron from "node-cron";
// 毎週月曜9:00 JST / Every Monday 09:00 JST
cron.schedule("0 9 * * 1", () => {
sendWeeklyReport();
}, { timezone: "Asia/Tokyo" });
// 式の事前検証 / Validate before scheduling
console.log(cron.validate("0 9 * * 1")); // trueGitHub Actions (YAML)
on:
schedule:
# JST 9:00 = UTC 0:00 (scheduleはUTCで評価される)
# Schedules are evaluated in UTC
- cron: "0 0 * * *"
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- run: echo "daily job"Python (croniter)
from croniter import croniter
from datetime import datetime
# 次の5回の実行時刻を計算 / Compute the next 5 run times
it = croniter("*/15 9-18 * * 1-5", datetime.now())
for _ in range(5):
print(it.get_next(datetime))Before / After 実例 / Before & After
例1: 毎日の深夜バッチ / Daily late-night batch
入力 / Input: 0 3 * * *↓
出力 / Output: 3時0分に実行 (= Runs at 03:00 every day)例2: ステップ値の展開 / Expanding a step value
入力 / Input: */10 * * * *↓
出力 / Output: 毎時0, 10, 20, 30, 40, 50分に実行
(= At minutes 0, 10, 20, 30, 40 and 50 of every hour)*/10 は「10分ごと」。展開された分のリストを見れば「毎時10分」との取り違えに気づけます。
The expanded minute list makes it obvious that */10 means "every 10 minutes," not "at :10."
例3: 平日朝の定時ジョブ / Weekday-morning job
入力 / Input: 0 9 * * 1-5↓
出力 / Output: 9時0分 月, 火, 水, 木, 金曜日に実行
(= At 09:00 on Monday through Friday)Why browser-only? / なぜブラウザ完結か
A cron expression looks harmless — just digits and asterisks. In practice, though, people rarely paste the expression alone. A full crontab line carries the command too: internal script paths, database names, backup destinations, sometimes credentials passed as flags or environment variables. Even the schedule by itself is operational intelligence — it tells an outsider exactly when your backups run, when maintenance windows open, and when monitoring is at its quietest. Sending all of that to a third-party server just to get a "human-readable description" back is an unnecessary disclosure. DevToolBox parses cron expressions entirely in your browser with plain JavaScript: no API call, no server-side logging of your input. You can verify this yourself — open DevTools → Network, parse an expression, and watch as no request leaves your machine. The next execution times are computed locally from your system clock and timezone.
cron式そのものは無害に見えますが、実際にはcrontabの行ごと(コマンド・スクリプトパス・接続先・ 環境変数入り)貼り付けられがちです。スケジュール自体も「バックアップが動く時間帯」「監視が手薄な時間帯」 という立派な運用情報です。本ツールは解析と次回実行時刻の計算をすべてブラウザ内のJavaScriptで行い、 ネットワーク送信は一切発生しません。DevTools → Networkタブが空のままであることで検証できます。
関連ツール / Related Tools
開発をもっと効率的に
PR
レンタルサーバー
エックスサーバー
国内シェアNo.1の高速レンタルサーバー(エックスサーバー社調べ)。WordPressも簡単セットアップ。
詳しく見る →レンタルサーバー
ConoHa WING
国内最速クラスのレンタルサーバー。独自ドメイン永久無料特典付き(特典内容は変更される場合があります)。
詳しく見る →レンタルサーバー
mixhost
高速SSD・HTTP/3対応のクラウド型レンタルサーバー。
詳しく見る →VPS
シンVPS
メモリ単価国内最安・オールNVMe SSD搭載の高性能VPS。開発・検証環境の構築に。
詳しく見る →Windows VPS
ConoHa for Windows Server
Windows環境のVPS。リモートデスクトップで開発・検証環境を構築。
詳しく見る →