Ubuntu Cron Guide
Ubuntu ships with cron (the cron package, built on Vixie cron) pre-installed and enabled on server and most desktop installs, managed as a systemd service. The scheduling syntax is identical standard 5-field cron, but Ubuntu's systemd integration and default package layout have a few of their own operational details worth knowing.
Syntax Notes
Same standard 5-field syntax as any Linux cron. The practical differences on Ubuntu are around service management (systemd) and default file locations, not the schedule syntax itself.
Examples
systemctl status cronsudo systemctl restart croncrontab -eGotchas
- Ubuntu's default crontab editor is nano, not vi — if you expect vi/vim keybindings, run `select-editor` once to change the default, or `EDITOR=vim crontab -e` for a one-off.
- Minimal/server Ubuntu installs (and some cloud images) don't always have cron installed by default — check with `dpkg -l | grep cron` and `sudo apt install cron` if it's missing.
- Snap-packaged applications run in a confined environment and may not see the same filesystem paths as a regular cron job — if a cron job needs to interact with a snap's data, check the snap's specific data directory conventions.
Best Practices
- Use `systemctl status cron` as your first troubleshooting step — if the service isn't active, no crontab entry will ever fire regardless of syntax.
- For Ubuntu Server cloud images (AWS, DigitalOcean, etc.), verify the system timezone with `timedatectl` before assuming cron runs in your local time — cloud images frequently default to UTC.
- Prefer `/etc/cron.d/` drop-in files over editing `/etc/crontab` directly for system-wide jobs installed by scripts or configuration management (Ansible, etc.) — it avoids merge conflicts with manual edits.
Frequently Asked Questions
- Is cron pre-installed on Ubuntu?
- On Ubuntu Desktop and most Ubuntu Server ISO installs, yes. Some minimal cloud images omit it — install with `sudo apt update && sudo apt install cron` if `crontab -e` reports command not found.
- How do I check if my cron job actually ran on Ubuntu?
- Check `grep CRON /var/log/syslog` (or `journalctl -u cron` on newer systemd-based logging) — every cron invocation attempt is logged there, whether it succeeded or failed.
- Does Ubuntu support @reboot?
- Yes — @reboot is supported and runs the command once when the cron daemon starts (typically at boot), useful for start-up scripts that don't need a full systemd unit.
Related Tools
Platform Guides
Cron syntax for Linux, Kubernetes, AWS, and more
macOS Cron Guide
How cron works on macOS, why Apple recommends launchd instead, and the Full Disk Access permission issue that silently breaks many cron jobs.
Windows Task Scheduler vs Cron
Compare Windows Task Scheduler and Unix cron: syntax, GUI vs config file, trigger types, and how to translate a cron expression into a scheduled task.