A cron job is a scheduled task that runs automatically at predefined times or intervals on Unix-based systems.
It is commonly used for repetitive operations such as backups, system maintenance, script execution, and server-side automation. Cron jobs rely on the cron scheduler and use a time-based expression to define when a command or script should run.
Also known as: Scheduled task, automated job.
Cron checks scheduled tasks in the background and executes them when their configured time is reached.
Cron jobs are typically defined in a crontab file. A standard cron expression contains five time fields followed by the command to execute:
* * * * * command
│ │ │ │ │
│ │ │ │ └─ Day of week
│ │ │ └─── Month
│ │ └───── Day of month
│ └─────── Hour
└───────── Minute
For example:
0 2 * * * /path/to/script.sh
This expression runs the specified script every day at 2:00 AM.