Cron @ Shortcuts

Learn cron shorthand aliases: @daily, @hourly, @weekly, @monthly, @yearly, @reboot. Easier than remembering expressions.

Cron provides several shorthand aliases that replace common 5-field expressions: @yearly (or @annually) runs once a year at midnight on January 1st (equivalent to 0 0 1 1 *). @monthly runs at midnight on the 1st of every month (0 0 1 * *). @weekly runs at midnight every Sunday (0 0 * * 0). @daily (or @midnight) runs at midnight every day (0 0 * * *). @hourly runs at the top of every hour (0 * * * *). @reboot runs once after the system starts up — this is not a recurring schedule but a one-time trigger. These shortcuts are supported by Vixie Cron (the default cron daemon on most Linux distributions including Ubuntu, Debian, and CentOS). They may not work on all cron implementations — for example, BusyBox cron and some minimal containers do not support them. If you need maximum portability, use the equivalent 5-field expression instead. The @reboot shortcut is particularly useful for starting services or running initialization scripts after a system restart. Unlike the time-based shortcuts, @reboot does not repeat — it fires once per boot. Note that on systemd-based systems, @reboot may fire before all network interfaces are fully up, so add a sleep or retry logic if your script requires network access. On Quartz Scheduler, these shortcuts do not exist — you must use the full 7-field expression. AWS EventBridge uses rate() for simple intervals and cron() for complex schedules. Kubernetes CronJob uses the standard 5-field format. Vercel Cron and GitHub Actions support some shortcuts but recommend explicit expressions for clarity.

FAQ

  • What does the cron expression @daily mean?

    The expression @daily means: . Each field in the cron expression controls a different time component: minute, hour, day of month, month, and day of week.

  • How do I add @daily to my crontab?

    Run crontab -e in your terminal to open your crontab editor. Add a new line: @daily /path/to/your/script.sh. Save and exit. Verify with crontab -l. Make sure your script is executable (chmod +x script.sh) and uses full paths for all commands.

  • What is the equivalent of @daily on Quartz / AWS / Kubernetes?

    Cron @ shortcuts like @daily are a convenience feature in Vixie Cron (the default on most Linux systems). Quartz uses 7-field expressions instead. AWS EventBridge uses rate() or cron() syntax. Kubernetes supports some @ shortcuts depending on the implementation.

  • What are common mistakes when using @daily?

    Common pitfalls: (1) Cron uses a minimal PATH — always use full paths to commands and scripts. (2) Percent signs (%) must be escaped with backslash in crontab. (3) Cron runs in the system timezone — set CRON_TZ=UTC at the top of your crontab for consistent UTC scheduling. (4) Redirect output to prevent email spam: @daily /path/command >> /var/log/myjob.log 2>&1. (5) Test your cron expression with crontab.guru or our validator above before deploying.

Platform Equivalents for @daily

The cron shortcut @daily expands to different expressions on various scheduling platforms:

PlatformExpression
Unix / Linux crontab@daily
Quartz Scheduler (Java)0 0 * * ?
AWS EventBridgecron(0 0 * * ? *)
Kubernetes CronJob0 0 * * *
Vercel Cron0 0 * * *
GitHub Actions0 0 * * * (UTC)

The @ shortcuts are a convenience feature of Vixie Cron (the default cron daemon on most Linux distributions). They translate to standard 5-field expressions internally. Not all platforms support these shortcuts — Quartz, AWS, and Kubernetes require the full expression form. Vercel Cron and GitHub Actions do support some @ shortcuts, but using the explicit 5-field form is more portable across platforms.

Getting Started with Cron

Follow these tips when setting up cron jobs in production:

  • Always use full paths to commands and scripts in your crontab, since cron runs with a minimal PATH environment (often just /usr/bin:/bin).
  • Redirect output to log files: command >> /var/log/myjob.log 2>&1 to capture errors and prevent cron from emailing you every execution.
  • Test your cron expression before deploying — use our validator above or crontab.guru to verify the schedule fires when you expect.
  • Set MAILTO="" at the top of your crontab to disable email notifications, or set MAILTO=your@email.com to receive error alerts.
  • Use flock or a PID file to prevent overlapping executions for jobs that may take longer than their scheduled interval.