Tools › Cron examples › twice a day
Cron expression for twice a day
The cron expression for twice a day is:
What it does
Runs at 06:00 and 18:00 every day.
Field by field
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | exactly 0 |
| Hour | 6,18 | list 6,18 |
| Day of month | * | every value |
| Month | * | every value |
| Day of week | * | every value |
Typical uses
Morning and evening digests, or two daily syncs.
Watch out for
A comma-separated list in the hour field is the simplest way to run at several specific times.
Add it to your crontab
crontab -e, then add:
0 6,18 * * * /path/to/command >> /var/log/myjob.log 2>&1
Related schedules
every minuteevery 5 minutesevery 10 minutesevery 15 minutesevery 30 minutesevery hourevery 2 hoursevery day at midnightevery day at 3amevery weekday at 9amevery 15 minutes during business hoursevery Mondayevery Sunday at midnighton weekendson the first day of every monthon the last day of the monthevery quarter