LINUX / A CONCEPT NOTE

Cron & Scheduling

running things later

~60 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

The cron daemon runs scheduled background scripts based on time expressions. Crontab files list schedule configurations (Minute, Hour, Day, Month, Day-of-Week).

02 / FOLLOW THE MECHANISM

How a cron job triggers

  1. Daemon check

    crond wakes up every 60 seconds and scans crontab schedules.

  2. Match

    identifies jobs matching the current system time.

  3. Execution

    spawns the command shell to execute the task in the background.

  4. Output Mail

    sends any stdout/stderr outputs to the user's mail box (or redirects to logs).

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

list cron schedules for the current user

crontab -l

EXAMPLE 02 · REFERENCE

edit user cron configuration schedules

crontab -e

Explore command anatomy in the CLI lab