Cron job every 30 minutes
The cron expression for every 30 minutes is */30 * * * *. The */30 step in the minute field fires at :00 and :30, twice an hour and 48 times a day.
*/30****Next 5 runs
Vercel always runs schedules in UTC, and GitHub Actions does unless you set a time zone. Crontab and Kubernetes use the server's time zone.
Field by field
*/30Minute- Every 30th minute: 0, 30
*Hour- Every hour, 0 to 23
*Day of month- Every day of the month
*Month- Every month
*Day of week- Every day of the week
By platform
Most schedulers take the same five fields. The wrapper, time zone and limits differ.
# m h dom mon dow command
*/30 * * * * /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1Runs in the server's local time zone
on:
schedule:
- cron: "*/30 * * * *"Runs in UTC unless you set a time zone
timezone next to cron to use local time. Runs often start late when GitHub is busy, most of all at the start of an hour. In a public repository, GitHub turns the schedule off after 60 days without activity.spec:
schedule: "*/30 * * * *"
timeZone: "Etc/UTC"
concurrencyPolicy: ForbidWithout timeZone, the controller's zone applies
aws events put-rule \
--name sync-every-30-minutes \
--schedule-expression "cron(0/30 * * * ? *)"Six fields, and one day field must be ?
? in day-of-month or day-of-week. For a plain interval, rate(30 minutes) is simpler, though its runs are timed from when you create the rule rather than by the clock.{
"crons": [
{ "path": "/api/sync", "schedule": "*/30 * * * *" }
]
}Needs a paid plan
Other 30-minute schedules
Change the starting minute to move runs off the hour and half hour, or narrow the hour and weekday fields.
| Expression | Runs |
|---|---|
0,30 * * * * | Same as */30 * * * *, with the minutes listed |
15,45 * * * * | Every 30 minutes at :15 and :45 |
*/30 9-17 * * 1-5 | Every 30 minutes from 09:00 through 17:30, Monday through Friday (the hour range includes 17:30) |
30 * * * * | Once an hour at half past, not every 30 minutes |
Every 45 or 90 minutes: intervals that don't divide an hour
A step like */30 counts within each hour and starts again at :00, so it only gives even gaps when it divides 60. */45 * * * * runs at :00 and :45, 45 minutes and then 15 minutes apart. Every 90 minutes can't be written in the minute field at all, since the field stops at 59.
Instead, find how long the pattern takes to repeat on the hour (3 hours for 45 and 90 minutes, 2 hours for 40) and write one line for each minute it lands on. For every 90 minutes that is two lines:
# Every 90 minutes: 00:00, 01:30, 03:00, 04:30 … 22:30
0 */3 * * * /usr/local/bin/job.sh
30 1-22/3 * * * /usr/local/bin/job.sh| Interval | Lines | Runs |
|---|---|---|
| 90 minutes | 0 */3 * * * and 30 1-22/3 * * * | 16 a day: 00:00, 01:30, 03:00 … 21:00, 22:30 |
| 45 minutes | 0,45 */3 * * *, 30 1-22/3 * * * and 15 2-23/3 * * * | 32 a day: 00:00, 00:45, 01:30, 02:15, 03:00 … 23:15 |
| 40 minutes | 0,40 */2 * * * and 20 1-23/2 * * * | 36 a day: 00:00, 00:40, 01:20, 02:00 … 23:20 |
Each repeat fits into a day exactly, so the gap stays the same across midnight. The hour field works the same way: 0 */5 * * * runs at 00:00, 05:00, 10:00, 15:00 and 20:00, then 4 hours later at midnight. In GitHub Actions, give each line its own - cron: entry under schedule; a Kubernetes CronJob and an EventBridge rule take one expression each, so make one per line.