Qaynaq LABS · TOOLS

CRON · DECODE

0 0 1 * 2

This cron expression runs at midnight (00:00) on the first day of every month, but only if that day is a Tuesday (day-of-week = 2).

Field-by-field

PositionValueMeaning
minute 0 The job runs at the 0th minute of the hour (i.e., the top of the hour).
hour 0 The job runs at the 0th hour of the day (i.e., midnight).
day-of-month 1 The job runs on the 1st day of the month.
month * The job runs every month, regardless of the month.
day-of-week 2 The job runs only if the day is Tuesday (2).

Next fires (UTC)

  • 2024-01-02 00:00:00 UTC
  • 2024-02-06 00:00:00 UTC
  • 2024-03-05 00:00:00 UTC
  • 2024-04-02 00:00:00 UTC

Watch out for

  • This expression will only fire if the 1st day of the month is a Tuesday. If the 1st is not a Tuesday, the job will not run that month.
  • The day-of-month (1) and day-of-week (2) fields are both specified, which creates an AND condition (not OR).

Equivalent forms

  • 0 0 1 * 2
  • 0 0 1 * 2-2/7 (equivalent, but more explicit)
  • 0 0 1 * 2#1 (if using '#' notation for nth weekday, but this is non-standard)

About cron expressions

Cron is the standard format Unix-like systems use to schedule recurring jobs: five space-separated fields representing minute, hour, day of month, month, and day of week. The syntax is dense but unambiguous — once you can read it, you can express almost any schedule.

Qaynaq Labs' cron decoder works in both directions: paste an existing expression to read it out in English, or describe a schedule and get a valid cron string back. Each result includes the next few fire times, any caveats (like end-of-month edge cases), and equivalent alternative forms.

Frequently asked

Why does the job not run every month?

Because the day-of-week field (2) restricts execution to only when the 1st day of the month is a Tuesday. If the 1st is not a Tuesday, the job is skipped.

Can I make this run on the first Tuesday of every month instead?

Yes, use the expression '0 0 1-7 * 2' to run on the first Tuesday of every month, or '0 0 ? * 2#1' (if your cron system supports '#' notation).

Does this work in all cron implementations?

Most standard cron implementations (e.g., Unix/Linux) support this syntax, but some systems (e.g., Windows Task Scheduler) use different formats. Always test in your environment.