Cron expressions for the schedules people ask for most
- Every 5 minutes: */5 * * * *
- Every 15 minutes: */15 * * * *
- Every hour, on the hour: 0 * * * *
- Every 2 hours: 0 */2 * * * (00:00, 02:00, 04:00 …)
- Every 4 hours: 0 */4 * * *
- Every 6 hours: 0 */6 * * * (00:00, 06:00, 12:00, 18:00)
- Every 12 hours: 0 */12 * * * (midnight and noon)
- Every day at midnight: 0 0 * * *
- Weekdays at 9:00: 0 9 * * 1-5
- First day of every month at midnight: 0 0 1 * *
Each of these is one click in the presets above, and the builder lists the next ten run times so you can see exactly when the job will fire.
The “every 6 hours” mistake
A schedule of * */6 * * * looks like “every 6 hours” but runs every minute from 00:00 to 00:59, then every minute from 06:00 to 06:59, and so on: 240 runs a day instead of 4. The star in the minute field means every minute. Hourly schedules need a fixed minute, which is why the builder switches the minute to 0 when you pick an hour while the minute is still set to every minute.
Steps also restart at the top of each range. */45 in the minute field runs at :00 and :45, not every 45 minutes around the clock, because the count starts again every hour. For an even spread that does not divide 60 or 24, run the job more often and let it decide whether enough time has passed.
Quartz, Spring and AWS use six fields
Linux cron, Laravel, GitHub Actions and Kubernetes CronJobs read the five fields shown here. Some schedulers add more:
- Quartz (Java) puts seconds first and needs a ? in either the day-of-month or the day-of-week field: 0 0 9 ? * MON-FRI.
- Spring’s @Scheduled also starts with seconds but does not need the question mark: 0 0 9 * * MON-FRI.
- AWS EventBridge wraps the expression in cron(…), adds a year field at the end, needs the ? like Quartz, and always runs in UTC: cron(0 9 ? * MON-FRI *).
Weekday numbers differ between them (Quartz and AWS count Sunday as 1, Linux cron as 0), so the builder writes days as MON, TUE and so on, which all of them read the same way. Quartz and AWS cannot say “on the 1st or on Mondays”; if you set both fields, they show no result.
Before you paste it into a crontab
Run crontab -e and add the expression followed by the command, using full paths, because cron starts with a very short PATH: 0 2 * * * /usr/bin/php /var/www/artisan backup:run >> /var/log/backup.log 2>&1. The redirect at the end keeps the output, which is the first place to look when a job seems not to run.
The run times here are shown in your own time zone. A server set to UTC runs 0 9 * * * at 09:00 UTC, which may be early morning or late evening where you are, so check the server’s time zone with date or timedatectl before you choose the hour.