Option 1: Install cronie (fastest)
sudo dnf install -y cronie sudo systemctl enable --now crond crontab -e
The service is crond, not cron. AWS documents cronie as an optional install, so it keeps working, but AWS also says a future Amazon Linux may drop classic cron support, and recommends migrating.
Option 2: Use a systemd timer (what AWS recommends)
A timer needs two files. This one runs a script every day at 02:30 UTC:
# /etc/systemd/system/backup.service [Unit] Description=Nightly backup [Service] Type=oneshot ExecStart=/usr/local/bin/backup.sh
# /etc/systemd/system/backup.timer [Unit] Description=Run backup daily at 02:30 [Timer] OnCalendar=*-*-* 02:30:00 UTC Persistent=true [Install] WantedBy=timers.target
sudo systemctl daemon-reload sudo systemctl enable --now backup.timer systemctl list-timers backup.timer
Persistent=true runs a missed job at boot if the instance was stopped at the scheduled time: something cron can't do. Output goes to the journal (journalctl -u backup.service), so you also avoid the lost-output problem.
Common cron → OnCalendar translations
| cron | OnCalendar |
|---|---|
*/5 * * * * | *:0/5 |
0 * * * * | hourly |
0 0 * * * | daily |
30 2 * * * | *-*-* 02:30:00 |
0 9 * * 1-5 | Mon..Fri *-*-* 09:00:00 |
0 0 1 * * | monthly |
Check any translation on the instance with systemd-analyze calendar "Mon..Fri *-*-* 09:00:00", which prints the next time it will fire. More in cron vs systemd timers.
Elastic Beanstalk and user data
If a deployment script or .ebextensions config writes to /etc/cron.d/, it silently does nothing on AL2023 until cronie is installed and crond is running. Add the install step to the same script.
Sources
Checked against these official sources and, where marked, tested on Ubuntu 24.04 (cron 3.0pl1-184ubuntu2). Last verified 18 November 2026.