A cron job belongs in a crontab when a maintenance command must keep running on schedule after the operator logs out. Backups, report scripts, cleanup commands, and health probes all need the same proof before handoff. The right account owns the entry, the command path is explicit, and a first scheduled run leaves visible output.
A per-user crontab is managed with crontab, and each active job line contains five time fields followed by the command. The cron daemon checks installed crontabs once per minute and reloads changed tables automatically, so saving through crontab -e installs the schedule without editing files under /var/spool/cron directly.
Cron starts jobs with a smaller environment than an interactive shell. Use absolute paths, explicit environment lines, and output redirection while testing. Some current cron implementations support a CRON_TZ environment line for a crontab-specific timezone, but Vixie/Debian-style cron may handle jobs in the daemon's timezone, so confirm timezone behavior on the target host before scheduling time-sensitive work. Escape any % inside the command as \% because cron treats unescaped percent signs as input separators.
Related: How to automate Linux backups
Tool: Crontab Generator
# m h dom mon dow command */15 * * * * /usr/local/bin/report-health.sh 0 2 * * * /usr/local/bin/backup-home.sh @daily /usr/local/bin/cleanup-temp.sh
The five fields are minute, hour, day of month, month, and day of week. Shorthand forms such as @hourly, @daily, and @reboot are supported by common Linux cron implementations.
If both day-of-month and day-of-week are restricted, many cron implementations run the command when either field matches.
$ crontab -e
The editor comes from $VISUAL or $EDITOR. Use sudo crontab -e only when the scheduled command truly needs to run as root.
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAILTO="" * * * * * /bin/date -u +\%Y-\%m-\%dT\%H:\%M:\%SZ >> /tmp/cron-proof.log 2>&1
Use absolute paths for commands, scripts, and log files because cron usually runs with a minimal PATH. Escape each % in date format strings as \%.
The crontab command installs the updated schedule for the current account. Do not edit /var/spool/cron or /var/spool/cron/crontabs directly.
$ crontab -l SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAILTO="" * * * * * /bin/date -u +\%Y-\%m-\%dT\%H:\%M:\%SZ >> /tmp/cron-proof.log 2>&1
Saving through crontab is normally enough. The cron daemon reloads changed crontabs automatically, so a service restart is not usually required.
Related: How to list cron jobs in Linux
$ cat /tmp/cron-proof.log 2026-06-13T02:03:01Z
A timestamp in the proof file confirms that cron matched the schedule and ran the command.
$ crontab -e
Keep the verified time fields when the interval is correct, then swap only the command and output path for the production job.
$ rm /tmp/cron-proof.log