All Cron Schedules
Cron Every 12 Hours
Run a cron job every 12 hours (twice daily):
0 */12 * * *
Understanding the Expression
The cron expression 0 */12 * * * breaks down as follows:
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | */12 | Every 12 hours |
| Day of month | * | Every day of the month |
| Month | * | Every month |
| Day of week | * | Every day of the week |
Example Usage
Basic crontab entry
0 */12 * * * /path/to/your/script.sh
With output logging
0 */12 * * * /path/to/script.sh >> /var/log/script.log 2>&1
With monitoring
0 */12 * * * /path/to/script.sh && curl -fsS https://cronsignal.io/ping/YOUR_CHECK_ID
Common Use Cases for Every 12 Hours
- Data synchronization: Sync data between systems periodically
- Batch processing: Process accumulated records in batches
- Report generation: Generate periodic status reports
- Cleanup tasks: Remove temporary files and stale data
Platform Equivalents
The same schedule expressed across common platforms and schedulers:
| Platform | Syntax |
|---|---|
| Linux crontab | 0 */12 * * * |
| GitHub Actions | - cron: '0 */12 * * *' |
| systemd timer | OnCalendar=0/12:00:00 |
| Kubernetes CronJob | schedule: "0 */12 * * *" |
| AWS EventBridge | cron(0 0/12 * * ? *) |
Timezone Considerations
0 */12 * * * fires at 00:00 and 12:00 UTC — midnight and noon. Absolute times, not a rolling 12-hour interval.
Common Mistakes
- Only 2 runs per day: Fires at midnight and noon UTC — not "12 hours after last run". A job starting at 8 AM runs next at noon (4 hours later).
- Twice-daily output: If generating reports or files, both runs produce output. Ensure naming handles AM/PM runs to avoid overwrites.
- AWS step syntax: Use
0/12not*/12:cron(0 0/12 * * ? *).
Monitor this schedule
Get alerted when your cron job doesn't run.
Sign up with Google
or
3 checks free. No credit card required.