Crontab Every 30 Minutes (*/30 * * * *)
Schedule a cron job every 30 minutes (at :00 and :30 of each hour). A low-frequency interval ideal for periodic reporting and data aggregation.
Detailed Explanation
Running a Cron Job Every 30 Minutes
The expression */30 * * * * fires at the top and bottom of every hour — specifically at minute 0 and minute 30.
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | */30 | Every 30th minute |
| Hour | * | Every hour |
| Day of Month | * | Every day |
| Month | * | Every month |
| Day of Week | * | Every day |
Execution Frequency
This runs 48 times per day (twice per hour x 24 hours), providing a balance between near-real-time processing and resource conservation.
Equivalent Syntax
*/30 * * * * is the same as 0,30 * * * *. Both produce identical schedules.
Comparison with Half-Hourly Alternatives
| Expression | Meaning |
|---|---|
*/30 * * * * |
Every 30 min (at :00 and :30) |
0 */2 * * * |
Every 2 hours (at :00 only) |
*/15 * * * * |
Every 15 min (4x per hour) |
Practical Example
# Aggregate logs and push to central server every 30 min
*/30 * * * * /scripts/aggregate-logs.sh >> /var/log/aggregate.log 2>&1
Output Handling
Always redirect output when using cron to avoid filling up cron's mail spool:
*/30 * * * * /scripts/job.sh >> /var/log/job.log 2>&1
Use Case
Half-hourly schedules work well for data aggregation pipelines, website sitemap regeneration, search index updates, social media feed polling, metrics rollup calculations, and periodic health reports that do not need minute-level granularity.