Crontab examples

Every schedule here is described by the same parser the generator uses. Open one to preview its runs, or copy it straight into crontab -e.

Minutes

ExpressionScheduleMeaning
* * * * *Every minuteEvery minute.
*/2 * * * *Every 2 minutesEvery 2 minutes.
*/5 * * * *Every 5 minutesEvery 5 minutes.
*/10 * * * *Every 10 minutesEvery 10 minutes.
*/15 * * * *Every 15 minutesEvery 15 minutes.
*/20 * * * *Every 20 minutesEvery 20 minutes.
*/30 * * * *Every 30 minutesEvery 30 minutes.

Hours

ExpressionScheduleMeaning
0 * * * *Every hourEvery hour, on the hour.
30 * * * *Every hour at :30At minute 30 past every hour.
0 */2 * * *Every 2 hoursEvery 2 hours, on the hour.
0 */3 * * *Every 3 hoursEvery 3 hours, on the hour.
0 */4 * * *Every 4 hoursEvery 4 hours, on the hour.
0 */6 * * *Every 6 hoursEvery 6 hours, on the hour.
0 */12 * * *Every 12 hoursEvery 12 hours, on the hour.

Days

ExpressionScheduleMeaning
0 0 * * *Every day at midnightAt 00:00, every day.
0 8 * * *Every day at 08:00At 08:00, every day.
0 12 * * *Every day at noonAt 12:00, every day.
30 2 * * *Nightly at 02:30At 02:30, every day.
0 9,17 * * *Twice a day (09:00, 17:00)At 09:00 and 17:00, every day.

Weeks

ExpressionScheduleMeaning
0 0 * * 0Every Sunday at midnightAt 00:00, on Sunday.
0 9 * * 1Every Monday at 09:00At 09:00, on Monday.
0 17 * * 5Every Friday at 17:00At 17:00, on Friday.
0 10 * * 6,0Weekends at 10:00At 10:00, on weekends.

Months & years

ExpressionScheduleMeaning
0 0 1 * *First day of every monthAt 00:00, on the 1st of the month.
0 0 15 * *15th of every monthAt 00:00, on the 15th of the month.
0 0 1 */3 *Every quarter (1st, 00:00)At 00:00, on the 1st of the month, every 3 months (January, April, July and October).
0 0 1 1 *Once a year (1 January)At 00:00, on the 1st of the month, in January.

Business

ExpressionScheduleMeaning
0 9 * * 1-5Weekdays at 09:00At 09:00, on weekdays (Monday through Friday).
*/15 9-17 * * 1-5Every 15 min, office hoursEvery 15 minutes between 09:00 and 17:59, on weekdays (Monday through Friday).
0 9-17 * * 1-5Hourly, 09–17, weekdaysEvery hour at :00, from 09:00 through 17:00, on weekdays (Monday through Friday).
0 18 * * 1-5Weekdays at 18:00 (end of day)At 18:00, on weekdays (Monday through Friday).
0 3 * * 0Weekly maintenance, Sun 03:00At 03:00, on Sunday.

More schedules and full crontab lines

LineWhat it does
0 0 * * 1-5Weekdays at midnight
0 22 * * 1-5Weekdays at 22:00
0 0 1,15 * *Twice a month, 1st and 15th
0 6 * * 6Saturday morning at 06:00
5 4 * * 0Sunday 04:05
0 0 1 1,4,7,10 *First day of each quarter
*/10 * * * * /usr/bin/flock -n /tmp/sync.lock /opt/sync.shEvery 10 minutes, skipping a run if the last one is still going
0 3 * * * /usr/bin/find /tmp -type f -mtime +7 -deleteNightly clean-up of week-old temp files
0 2 * * * pg_dump mydb | gzip > /backups/db-$(date +\%F).sql.gzNightly database dump (note the escaped %)
@reboot /home/app/start.sh >> /var/log/app.log 2>&1Start an app when the machine boots