The Ultimate Cron Expression Generator
Schedule
Generated Expression
Translation
Every minute.
Next 5 Scheduled Runs
Welcome, Automator! (A Simple Guide to Cron)
In the vast, humming world of servers and software, **Cron** is the invisible, tireless gnome that works behind the scenes. It's a time-based job scheduler, a fundamental tool in any Unix-like system, that lets you automate tasks. Need to run a backup every night? That's Cron. Need to clear out temporary files every hour? Cron again. Need to send a report every Monday morning? You guessed it, Cron. This automation is controlled by a **Cron Expression**, a short, powerful string of five values that looks a bit like code: `* * * * *`. While it might seem cryptic, this little string is a precise language for telling the server *exactly when* to perform a task. It's the secret sauce behind countless automated processes that keep the digital world running smoothly.
But memorizing that syntax can be a real headache. Is Day of the Week the third or fifth value? Does it start at 0 or 1? Getting it wrong can mean your critical backup script runs every minute instead of once a day! This tool is designed to be your personal interpreter, translating your human idea of a schedule into a perfect, machine-readable cron expression. You don't need to remember any rules; just click the times you want. The tool builds the expression for you in real-time and, more importantly, translates it back into plain English so you can be absolutely sure it's doing what you expect. It even shows you the next five times the job will run, giving you total confidence in your automated tasks.
How to Use The Generator
Building your cron schedule is easy and error-proof:
- Start with a Preset (Optional): For common schedules, just click one of the preset buttons like "Hourly" or "Daily" to get an instant starting point.
- Click Through the Tabs: Use the tabs (Minutes, Hours, Day of Month, etc.) to navigate through the different parts of the schedule.
- Select Your Timing: In each tab, click on the numbers to select specific times. Want to run a task at 9 AM and 5 PM? Go to the "Hours" tab and click on "9" and "17". You can select multiple values in each category.
- See the Live Results: The "Generated Expression" panel on the right updates with every single click. You'll see the cron string, a simple English translation, and a list of the next 5 scheduled run times based on your local clock.
- Copy, Share, and Go: Once you're happy, click "Copy" to paste the expression into your server's crontab. Or, click "Share Link" to get a unique URL that saves your exact configuration.
Tips for Cron Masters
- The Asterisk (`*`) Means "Every":** If you don't select any specific values in a category, it defaults to an asterisk (`*`). This is a wildcard that means the job will run for *every* value in that category (e.g., every minute of every hour).
- Smart Ranges:** This tool is smart! If you select "2", "3", "4", and "5" in the Hours tab, it will automatically generate the compact `2-5` range in the final expression instead of a long list.
- **The "OR" Condition Trap:** Be very careful when you specify both a "Day of Month" AND a "Day of Week." Most cron systems treat this as an **OR** condition. For example, if you set a job to run on the 15th of the month AND on Fridays, the job will run on the 15th (no matter what day it is) AND it will run every Friday (no matter the date). To run a job only on Friday the 15th, you need a different approach, usually by checking the date inside your script itself. For most simple schedules, it's best to use one or the other and leave the one you're not using as `*`.
- **Remember Server Time:** Cron jobs always run based on the server's internal clock and timezone. The "Next 5 Scheduled Runs" in this tool are calculated using *your* local browser time, which is a great way to confirm your logic. However, if your server is in a different timezone (e.g., UTC), the actual execution times will be different. Always be mindful of where your code is running!
Read Also: