Cron Predefined Macros
Convenient shortcuts for common scheduling patterns.
Macros: Predefined shortcuts that replace common cron expressions for better readability.
Standard Macros
| Macro | Equivalent | Description |
|---|---|---|
| @yearly | 0 0 1 1 * | Once per year (Jan 1st) |
| @annually | 0 0 1 1 * | Same as @yearly |
| @monthly | 0 0 1 * * | Once per month (1st day) |
| @weekly | 0 0 * * 0 | Once per week (Sunday) |
| @daily | 0 0 * * * | Once per day (midnight) |
| @midnight | 0 0 * * * | Same as @daily |
| @hourly | 0 * * * * | Once per hour |
| @reboot | n/a | At system startup |
Usage Examples
# Using macros in crontab
@daily /opt/scripts/daily-backup.sh
@weekly /opt/scripts/weekly-cleanup.sh
@monthly /opt/scripts/monthly-report.sh
@hourly /opt/scripts/health-check.sh
@reboot /opt/scripts/startup-tasks.sh