Basics

Cron vs Quartz Cron

Linux cron and Quartz cron look similar, but they are not interchangeable. The biggest differences are field count and special characters.

Field count

Linux cron usually has 5 fields. Quartz cron usually has 6 or 7 fields because it includes seconds and may include year.

0 9 * * 1-5        # Linux: weekdays at 9 AM
0 0 9 ? * MON-FRI   # Quartz: weekdays at 9 AM with seconds

Syntax differences

  • Quartz includes a seconds field at the beginning.
  • Quartz supports ? in day-of-month and day-of-week.
  • Quartz supports L, W, and # in some fields.
  • Linux cron is simpler and more common in crontab files.

Common mistakes

  • Pasting a Quartz expression into Linux crontab.
  • Forgetting the seconds field when moving from Linux cron to Quartz.
  • Using Quartz-only characters in tools that validate Linux cron.

FAQ

Is Quartz cron the same as Linux cron?

No. Quartz commonly uses 6 or 7 fields and supports additional special characters.

Does CronTools validate Quartz cron?

The current CronTools validator focuses on Linux 5-field cron expressions.