Skip to content
Commitpedia
Log in Join & edit

What is a cron job?

A cron job is a command scheduled to run automatically at set times, such as every night at two o'clock.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of What is a cron job?: 1 recorded edit
Edit history · 1 edit
Type
Article
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Reading
1 min

A cron job is a scheduled task on Unix systems. The cron daemon wakes up every minute, checks a table of jobs, and runs anything whose time has come. It is an alarm clock for commands: set it once and it rings every day, every Monday, or every five minutes without you touching it.

Backups, log rotation, certificate renewal and report emails are classic cron jobs. Each line in a crontab has five time fields (minute, hour, day of month, month, weekday) followed by the command. The job runs with a minimal environment, so use full paths and redirect output to a log file, otherwise failures are silent. systemd timers are the modern alternative with the same purpose.

crontab -e
0 2 * * * /home/me/backup.sh >> /home/me/backup.log 2>&1

See also: What is a daemon or service? and What is a backup snapshot?

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +829 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?