---
title: "Cron"
description: "Cron is the background daemon on Unix and Linux systems that runs commands on a schedule. Learn the five-field time syntax and common server use cases."
url: "https://nodea.io/en/glossary/cron"
lang: "en"
updated: "2026-07-13"
---

# Cron

> Cron is the time-based job scheduler daemon of Unix-like operating systems. It runs commands and scripts automatically at defined times — every minute, hour, day or on specific weekdays.

**Cron** is the classic time-based job scheduler of Unix-like operating systems — a daemon that runs continuously in the background and executes commands or scripts at times you define. The name derives from the Greek *chronos* (time). Present on virtually every Linux server, cron is the default answer whenever something needs to happen automatically and repeatedly without a human at the keyboard.

## How cron works

The daemon wakes once a minute and scans its schedule sources: per-user [crontab](https://nodea.io/en/glossary/crontab) files, the system-wide */etc/crontab*, and drop-in directories such as */etc/cron.d* or */etc/cron.daily*. Any entry whose time specification matches the current minute gets executed. Each schedule line uses five time fields followed by the command:

**minute hour day-of-month month day-of-week command**

For example, *0 2 \* \* 0 /opt/scripts/db-backup.sh* fires every Sunday at 02:00. Asterisks mean "any value", slashes define steps (*\*/10* in the minute field means every ten minutes), and commas or ranges build lists. Shortcuts like *@daily*, *@weekly* and *@reboot* cover the common cases without arithmetic.

One crucial detail: cron executes jobs in a bare-bones environment with a minimal *PATH* and none of your interactive shell configuration. Scripts that run fine by hand routinely fail under cron until every path is made absolute and required variables are set explicitly.

## Practical applications

On a typical web server, cron quietly handles the plumbing:

- nightly database dumps and file backups,
- log rotation and cleanup of temporary files,
- SSL certificate renewal (Let's Encrypt's certbot relies on it),
- queue processing and scheduled emails,
- application schedulers — WordPress wp-cron replacement, Laravel's *schedule:run*, Magento indexers.

On shared hosting, [cron jobs](https://nodea.io/en/glossary/cron-job) are usually managed through the control panel (cPanel, DirectAdmin, Plesk); on a VPS you edit schedules yourself over [SSH](https://nodea.io/en/glossary/ssh). Whichever way you run it, log each job's output and monitor that it actually executes — a silently failing backup job is the kind of problem you only discover on the worst possible day.

### Why does my script work in the terminal but fail under cron?

Cron runs jobs in a minimal environment: no interactive shell profile, a stripped-down PATH and no session variables. Use absolute paths for every binary and file, set required environment variables inside the script or crontab, and redirect output to a log file to see the actual error.

## Related

- [Cron job](https://nodea.io/en/glossary/cron-job)
- [Crontab](https://nodea.io/en/glossary/crontab)
- [SSH](https://nodea.io/en/glossary/ssh)
- [Backend](https://nodea.io/en/glossary/backend)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/cron.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
