Cron Job Schedule Builder
Visual tool to generate "Crontab" expressions. Define your timing and your script path to get a ready-to-use command.
Tip: Always use absolute paths (starting with /) to ensure the server finds your script.
* * * * * [your_command_here]
Why specify a path?
When a Cron Job runs, it doesn't have the same "environment" as your terminal. It might not know where python or your script is located.
By providing the Full Absolute Path (e.g., /usr/bin/python3), you guarantee that the task will execute successfully every time, regardless of the system's default state.
Common Schedule Examples
Real-World Use Cases
Database Backups
Run a SQL dump at 2 AM daily to ensure data safety.
0 2 * * * /usr/bin/mysqldump ...
Log Rotation
Clear out massive error.log files every Sunday at midnight.
0 0 * * 0 /usr/bin/truncate -s 0 /var/log/app.log
SSL Renewals
Check for Certbot renewals twice a day automatically.
0 0,12 * * * /usr/bin/certbot renew
Reading and writing cron schedules
A cron expression is five fields separated by spaces: minute, hour, day of month, month, and day of week. Each field either names a specific value or uses a wildcard to mean every possible value. Once you can read the five positions, the rest is detail.
The operators you will actually use
An asterisk means every value for that field. * * * * * therefore runs once a minute, every minute, forever.
A slash defines a step. */15 in the minute field means every fifteenth minute, giving you four runs an hour at :00, :15, :30 and :45.
A comma lists specific values, so 0,30 runs on the hour and the half hour. A hyphen defines an inclusive range, so 9-17 in the hour field covers the working day.
Day of week runs from 0 to 6 starting on Sunday, though most implementations also accept 7 for Sunday and three-letter names such as MON.
The mistakes that cost people a weekend
Setting both day of month and day of week produces an OR, not an AND. 0 0 1 * 1 runs on the first of the month and on every Monday, which is almost never what the author intended. Leave one of the two as an asterisk.
Cron jobs run with a minimal environment and a bare PATH, so a command that works in your shell may fail under cron. Use absolute paths to every binary and script, and redirect output to a log file so failures leave evidence.
The schedule follows the server's timezone, not yours. On a host set to UTC, a job written for 9am local will fire at the wrong hour, and daylight saving shifts make the gap move twice a year.
Log everything
Append output with >> /path/to/log 2>&1. A silent cron failure is almost impossible to diagnose later.
Test the command first
Run it manually with env -i to simulate cron's empty environment before trusting the schedule.
Avoid overlap
If a job can run longer than its interval, add a lock file so two copies never run at once.
Frequently asked questions
What do the five fields mean?
In order: minute, hour, day of month, month, and day of week. Each accepts a number, a wildcard, a list, a range, or a step.
Why does my cron job work manually but not on schedule?
Cron provides a minimal environment with a short PATH and no shell profile. Use absolute paths for every command and file the job touches.
How do I run something every 30 seconds?
Cron's smallest unit is one minute. Either schedule two jobs offset by a sleep, or use a systemd timer, which supports sub-minute intervals.
What timezone does cron use?
The server's configured timezone. Check with the date command on the host rather than assuming it matches your own.