How cron runs scheduled jobs, the five crontab time fields, where system cron files live and how systemd timers compare.
cron is the classic Unix daemon that runs commands on a schedule. Each user has a crontab, edited with crontab -e, in which every line has five time fields (minute, hour, day of month, month, day of week) followed by the command. System jobs live in /etc/crontab and /etc/cron.d/.
'30 2 * * *' means 02:30 every day; '*/10 * * * *' every ten minutes; '0 9 * * 1' 09:00 every Monday. Day of week 0 and 7 are Sunday.
Files in /etc/cron.d/ and /etc/crontab have an extra field, the user name, between the time and the command. Directories such as /etc/cron.daily hold scripts run once a day.
cron runs with a minimal environment: use full paths or set PATH in the crontab. Output is mailed to the owner or lost; redirect it to a log file. The % character has a special meaning in crontab lines and must be escaped as \%.
On systemd distributions, .timer units are an alternative with logging in the journal, randomised delays and catch-up of missed runs (Persistent=true).
crontab -e/usr/local/bin/backup.sh >> /var/log/backup.log 2>&1crontab -lcrontab -r' deletes the whole crontab without asking.Last updated: 2026-10-08
What a systemd unit is, the common unit types, and how to start, stop, enable and inspect services with systemctl.
What logrotate does, how its configuration in /etc/logrotate.conf and /etc/logrotate.d works, and how to test a rule safely.
How to read logs with journalctl, check how much space the journal uses and shrink it safely with --vacuum options.