curly{bits}

curlybits / Cron Generator / Cron Every 30 Minutes

Cron Job Every 30 Minutes

To run a cron job every 30 minutes, use */30 * * * *. It runs on the hour and at half past, 48 times a day.

Common schedules:

Next 10 runs

How to use the Cron Job Every 30 Minutes

  1. Copy */30 * * * * and put your command after it in your crontab (open it with crontab -e).
  2. Check the next run times below, in UTC or your server's time zone.
  3. Need something slightly different? Edit any field and the description updates as you type.

The crontab line

*/30 * * * * /path/to/your-script.sh >> /var/log/your-script.log 2>&1

The five fields are minute, hour, day of month, month and day of week. Redirecting output to a log file (>> … 2>&1) keeps errors you'd otherwise never see.

Good for

  • Backing up a database that changes often
  • Pulling exchange rates or prices
  • Cleaning up temporary files

Variations

0,30 * * * *The same schedule, written as a list
15,45 * * * *At quarter past and quarter to
*/30 8-20 * * *Every 30 minutes from 8:00 AM to 8:30 PM

Same schedule elsewhere

GitHub Actionson: schedule: - cron: '*/30 * * * *' (always UTC)
Kubernetesspec.schedule: "*/30 * * * *" in a CronJob
Vercel"crons": [{"path": "/api/job", "schedule": "*/30 * * * *"}] in vercel.json

Frequently asked questions

Why not use */45 for every 45 minutes?

Steps restart every hour, so */45 runs at :00 and :45, then :00 again 15 minutes later. Cron can't do “every 45 minutes” evenly. Run every 15 minutes and skip runs in your script instead.

What time zone does it use?

The time zone of the machine or service running cron, which is usually UTC on servers and cloud schedulers. GitHub Actions always uses UTC.