What is Asterisk Wildcard (*)?

A special character meaning "every possible value" in a cron expression field.

Definition

The asterisk (*) is the most fundamental cron special character. When placed in any field, it means "match every possible value for this field." For example, * in the hour field means "every hour" (0-23), and * in the day-of-week field means "every day." The expression * * * * * matches every minute of every hour of every day.

๐Ÿ’ก

Simple Analogy

The asterisk is like saying "any" or "all" โ€” it is a blank check that matches everything in that time slot.

Why It Matters

The asterisk is the most-used and most-misunderstood cron character. It is the default value for any field you want to leave unrestricted. Understanding it prevents the classic mistake of writing * when you mean a specific value.

How to Verify

Read each field left to right and translate * as "every." The expression "*/5 * * * *" reads as "every 5th minute, every hour, every day of month, every month, every day of week." If you see more runs than expected, check if you accidentally left a * where you needed 0.

โš ๏ธ

Common Mistakes

The #1 cron mistake: writing "* 9 * * *" thinking it means "at 9 AM." It actually means "every minute during the 9 AM hour" โ€” 60 executions instead of 1. The correct expression is "0 9 * * *" (minute 0 of hour 9).

โœ…

Best Practices

When building a new expression, start with "0 0 * * *" (daily at midnight) and modify from there. Never start with "* * * * *" and try to narrow down. For any field you want to restrict, replace the * with a specific value first.

Cron Expression Generator

Build your cron expression

Try it free โ†’

Frequently Asked Questions

What is Asterisk Wildcard (*)?

The asterisk (*) is the most fundamental cron special character. When placed in any field, it means "match every possible value for this field." For example, * in the hour field means "every hour" (0-23), and * in the day-of-week field means "every day." The expression * * * * * matches every minute of every hour of every day.

Why does Asterisk Wildcard (*) matter for cron jobs?

The asterisk is the most-used and most-misunderstood cron character. It is the default value for any field you want to leave unrestricted. Understanding it prevents the classic mistake of writing * when you mean a specific value.

What are best practices for Asterisk Wildcard (*)?

When building a new expression, start with "0 0 * * *" (daily at midnight) and modify from there. Never start with "* * * * *" and try to narrow down. For any field you want to restrict, replace the * with a specific value first.

Related Terms