Every minute
What is Cron Generator?
Cron is a time-based job scheduler in Unix-like operating systems that enables users to schedule jobs (commands or scripts) to run periodically at fixed times, dates, or intervals. A cron expression is a string comprising five or six fields separated by spaces that represents a schedule. Cron jobs are essential for automated tasks like backups, log rotation, data processing, and system maintenance.
How to Use
- Select individual field values or use presets for common schedules.
- Each field represents a time component: minute, hour, day, month, weekday.
- Use * (asterisk) for 'any value' - matches all possible values for that field.
- Use */n for intervals - e.g., */5 means 'every 5 units'.
- Use commas for multiple values - e.g., '1,15' means 'at 1 and 15'.
- Click 'Copy' to copy the generated expression to your clipboard.
Why Use This Tool?
Tips & Best Practices
- 0 0 * * * runs at midnight every day - perfect for daily backups
- */5 * * * * runs every 5 minutes - useful for frequent monitoring
- 0 9 * * 1-5 runs at 9 AM on weekdays - ideal for workday tasks
- Always test new cron expressions before deploying to production
- Consider timezone differences when scheduling time-sensitive jobs
- Use meaningful descriptions in your crontab comments for documentation
Frequently Asked Questions
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 is Sunday). Some systems add a sixth field for seconds. Each field defines when the job should run. An asterisk (*) means 'every possible value' for that field.
How do I run a job every N minutes/hours?
Use the step value syntax */n. For example, */5 * * * * runs every 5 minutes, */30 * * * * runs every 30 minutes, and 0 */2 * * * runs every 2 hours at minute 0. This is cleaner than listing all values manually.
Can I run a job on specific days?
Yes! Use specific values in day fields. For example, 0 0 1,15 * * runs on the 1st and 15th of every month at midnight. 0 9 * * 1,3,5 runs at 9 AM on Monday, Wednesday, and Friday. You can also use ranges like 1-5 for Monday through Friday.
What's the difference between day of month and day of week?
Day of month (1-31) matches specific calendar dates. Day of week (0-6) matches days like Monday, Tuesday. If both are specified (not *), the job runs when EITHER condition matches. If you want both conditions, some cron systems require special syntax.
How do I handle timezone issues?
Cron uses the system's local timezone by default. For consistent scheduling across servers, either set all servers to the same timezone (recommended UTC), or use cron's special strings like @daily which are timezone-agnostic. Some modern systems support explicit timezone specification.
What are cron special strings?
Some cron systems support shorthand: @yearly or @annually (0 0 1 1 *), @monthly (0 0 1 * *), @weekly (0 0 * * 0), @daily or @midnight (0 0 * * *), @hourly (0 * * * *), and @reboot (runs at startup). These are convenient alternatives to full expressions.