Use it to automate recurring tasks, or when a scheduled job did not run or failed.
Scheduling
Scheduling runs jobs automatically at set times: cron (crontab, /etc/cron.d, /etc/cron.daily …), systemd timers, and at for one-off jobs.
1. Which scheduler: cron or systemd timer?
2. Did it start? cron log (journalctl -u cron/crond) or systemctl list-timers.
3. Run the command by hand as the same user with a minimal env: env -i /bin/sh -c '<cmd>'.
4. Output/errors captured? Add >> /var/log/job.log 2>&1.
5. Fix paths or permissions and wait for the next run.
schedule defined → scheduler triggers at the time → job runs as the user with a minimal environment → exit status and output logged
For Scheduling, continue with the first unproven Topic check: Record scheduler, owner, exact expression/calendar, timezone, expected trigger time and original workload acceptance test. If that boundary is healthy, advance to the adjacent check: Read back effective loaded schedule and eligibility including enablement, daemon/timer state and any persistent/catch-up semantics. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
crontabPrimary Commands
Configuration and operational commands for this Topic.
crontabReferenceList, install, edit or remove per-user cron schedules.
Use when: Primary lookup intent: configure. Use crontab when the lookup goal is to list, install, edit or remove per-user cron schedules. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Post-change verification for crontab: Read back the effective crontab and verify scheduler logs plus the job effect at the next controlled trigger. Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: configure. Safety class: changes_state. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. crontab is documented as an operational lookup primitive under Scheduling. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
atReferenceQueue commands for one-time execution by the at daemon at a specified time.
Use when: Primary lookup intent: configure. Use at when the lookup goal is to queue commands for one-time execution by the at daemon at a specified time. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Post-change verification for at: Confirm queue state, execution logs and the actual target effect at or after the intended trigger. Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: configure. Safety class: changes_state. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. at is documented as an operational lookup primitive under Scheduling. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
schedule source → scheduler load/enablement → clock + timezone → eligibility/next trigger → execution identity/environment → process start → exit/result → target read-back → workload acceptance
Healthy evidence: the authoritative schedule is loaded, next/last trigger evidence matches the intended clock basis, the job starts under the expected identity/environment, and the target state/workload verifies.
Step 2 Commands Verify boundary
crontab -l
systemctl list-timers
ls /etc/cron.d
Step 3 Verification and output interpretation Verify boundary
Verification path. Verify current wall time/timezone, synchronization state and source quality rather than only daemon-active status. Compare offset/stratum/reach or chrony tracking/sources and confirm DNS/network reachability to time sources. For scheduled jobs, inspect the scheduler’s calculated next/last trigger, unit/job exit status and resulting side effect. Correlate logs using monotonic/boot identifiers when wall-clock corrections could reorder timestamps.
Existing fast checks for this Topic. - Record scheduler, owner, exact expression/calendar, timezone, expected trigger time and original workload acceptance test.
- Read back effective loaded schedule and eligibility including enablement, daemon/timer state and any persistent/catch-up semantics.
- Correlate the trigger window with logs/process evidence, effective identity, environment, working directory, command path and exit/status data.
- Change one demonstrated cause, then wait for or deliberately reproduce the scheduled path and verify the original target state plus a regression run.
Verification chain. schedule source → scheduler load/enablement → clock + timezone → eligibility/next trigger → execution identity/environment → process start → exit/result → target read-back → workload acceptance
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: the schedule exists only on disk, timezone assumptions differ, scheduler is disabled, PATH/environment differs from an interactive shell, overlapping/missed triggers occur, or scheduler reports success while the target state is wrong.
It does not show behavior outside the captured host, clock/timezone, scheduler or time-daemon instance, identity/environment, source, trigger/measurement interval or workload scope. Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully.
Next check: Continue from the first unproven scheduling/time boundary: preserve the original timing and execution/source context, capture the adjacent scheduler/process or clock/source state, change only the demonstrated cause, then repeat the original scheduled or time-sensitive workload and regression checks.
Step 5 Common mistakes Narrow the fault
- Jobs depending on the login shell environment.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
cron is the traditional periodic Linux scheduler that evaluates crontab entries against wall-clock fields and launches commands in a minimal non-interactive environment under a defined account.
Subtopic /etc/cron.*`/etc/cron.*` represents distribution-managed periodic scheduling directories and system crontab conventions such as `/etc/cron.daily`, `/etc/cron.hourly` and `/etc/cron.d`, whose execution rules differ from per-user crontabs.
Subtopic systemd Timerssystemd timers schedule service-unit activation using calendar (`OnCalendar`) or monotonic timers (`OnBootSec`, `OnUnitActiveSec`, etc.), with explicit enablement, persistence, accuracy/randomization and unit dependency semantics.
Scheduled jobs run with a minimal environment (short PATH, no aliases, no terminal) — use full paths and log output. Check whether the scheduler ran the job before debugging the job itself.
systemctl list-timers --all— systemd timers and next runcrontab -l -u <user>— a user's cron jobsls /etc/cron.d /etc/cron.daily— system cron jobsjournalctl -u cron -u crond --since today— cron executions
ReferenceWhat it is1 section · depth on demand
Core model
Start with the exact schedule owner, scheduler type, expression/calendar, timezone, execution identity, working directory and environment. Show that the schedule is loaded and eligible, correlate the expected trigger window with scheduler logs/state, then separate process start, exit result and downstream workload verification. A configured job is only requested state; a trigger is only an accepted execution attempt.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully.
In depth
Scheduling jobs on Linux: cron, timers and at
Linux offers several ways to run jobs later or on a schedule. The crontab(5) manual page defines cron's format:
- Five time fields: minute, hour, day of month, month and day of week, with 0 or 7 for Sunday.
- Shortcuts such as
@reboot,@dailyand@hourly. - Steps such as
*/15.
The manual also points out two traps. When both day of month and day of week are restricted, the job runs when either matches. And an unescaped % in the command becomes a newline.
Choosing a scheduler
| Need | Tool |
|---|---|
| A recurring job, simple and portable | cron (crontab -e, /etc/cron.d/) |
| Recurring, with logging, dependencies, resource limits and catch-up | systemd timer |
| A one-off job at a time | at 02:00, or systemd-run --on-calendar=... |
| A job after boot | @reboot in cron, or OnBootSec= in a timer |
| Spread across many hosts | RandomizedDelaySec= in a timer |
cron and systemd timers compared
| cron | systemd timer | |
|---|---|---|
| Definition | One line | A .timer and a .service |
| Output | Mailed (MAILTO) or lost | The journal, per unit |
| Missed runs while off | Lost (unless anacron) | Persistent=true |
| Overlapping runs | Possible | A running service isn't started twice |
| Environment | Minimal; different from your shell | Fully defined in the unit |
| Listing all jobs | Spread across user crontabs and files | systemctl list-timers |
Seeing all scheduled jobs
host$ systemctl list-timers --all --no-pager | head -6
NEXT LEFT LAST PASSED UNIT
Sat 2026-11-28 15:00:00 CET 38min Sat 2026-11-28 14:00:00 CET 21min sysstat-collect.timer
Sun 2026-11-29 00:00:00 CET 9h left Sat 2026-11-28 00:00:04 CET 14h ago logrotate.timer
host$ sudo ls /var/spool/cron/crontabs/ /var/spool/cron/ 2>/dev/null
host$ for u in $(cut -d: -f1 /etc/passwd); do sudo crontab -l -u "$u" 2>/dev/null | sed "s/^/$u: /"; done | grep -v '^.*: #'
host$ ls /etc/cron.d/ /etc/cron.daily/
host$ atq
host$ echo "systemctl restart report-api" | sudo at 02:30 tomorrow
An inventory of jobs
Jobs hide in many places: user crontabs, /etc/crontab, /etc/cron.d, the cron.* directories, timers and the at queue. When you take over a server, list them all, as above, before changing schedules or shutting the host down.
Documented example, not captured output.
How it works at runtime
Scheduling is part of Scheduling. Linux Scheduling is the operational reference for proving when and under which identity/environment a non-interactive job is expected to run, whether the scheduler actually triggered it, and whether the invoked workload completed with the intended effect.
Runtime state ownership and mechanics. Linux exposes wall clock, monotonic clocks, hardware RTC and timezone presentation as separate concepts. NTP/chrony disciplines the system clock from selected sources using offset, delay, jitter, reachability and clock-quality information. Cron and systemd timers schedule from calendar or monotonic semantics, and missed-run/persistence behavior differs. Time jumps, DST and suspend/resume can therefore affect schedules and logs in ways that simple clock display does not explain.
Topic-specific state model. Linux Scheduling is the operational reference for proving when and under which identity/environment a non-interactive job is expected to run, whether the scheduler actually triggered it, and whether the invoked workload completed with the intended effect.
Technical metadata. Host/VM, distribution/kernel/systemd/cron/chrony versions, wall-clock UTC/local time + numeric offset, monotonic/uptime context, timezone/tzdata, RTC/clocksource/virtualization, scheduler/unit/crontab owner, schedule expression/calendar/next+last trigger, effective user/group/environment/PATH/cwd, process/exit/output, time daemon/configured sources/selected source/stratum/reach/offset/delay/jitter/frequency/leap state, logs and original workload result.
Interpretation rule. - A schedule configured ≠ the scheduler loaded or enabled it.
- A scheduler trigger ≠ the command started with the intended user, environment or working directory.
- Exit code 0 ≠ the intended target state or downstream workload result was achieved.
- One successful manual run ≠ the scheduled non-interactive execution path will behave the same.
Quick reference
Scheduling options on Linux:
| Tool | Strengths |
|---|---|
| cron | Simple, universal, per-user crontabs |
| systemd timers | Logging, dependencies, missed runs, resource limits |
| at / batch | One-off jobs |
| anacron | Daily/weekly jobs on machines that are not always on |
crontab -l; ls /etc/cron.d
systemctl list-timers
atq; echo 'reboot' | at 02:00 tomorrow
Whatever you choose, make jobs idempotent, log output, alert on failure, and avoid overlapping runs (flock).
Limits and how it fails
Primary failure point. Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully.
Model. A running NTP daemon can be unsynchronized, and a low stratum number does not guarantee a good local measurement. Timezone changes alter presentation/scheduling without directly changing UTC. Cron entry presence does not show execution or successful job outcome. systemd timer activation shows a trigger, not the service result. TLS, Kerberos, DNSSEC and distributed logs can fail because of time even when ordinary connectivity is healthy.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Configuration intent and lifecycle. Set authoritative timezone separately from time synchronization sources. Configure NTP servers/pools and access policy through the active implementation, and avoid running competing time daemons. For scheduled work, choose cron or systemd timer semantics deliberately, including timezone, persistent catch-up and dependency/environment requirements. Remember that cron/systemd environments are not interactive shells and should declare paths/credentials explicitly.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Scheduling. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Scheduling operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Scheduling.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Linux Scheduling is the operational reference for proving when and under which identity/environment a non-interactive job is expected to run, whether the scheduler actually triggered it, and whether the invoked workload completed with the intended effect. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin exact symptom + clock/trigger time → identify authoritative scheduler or time daemon → read back effective configuration/runtime state → reproduce or observe the expected event/source measurement → correlate identity/environment/offset/status with logs → change one demonstrated cause → read back stable state → repeat original scheduled or time-sensitive workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | schedule source → scheduler load/enablement → clock + timezone → eligibility/next trigger → execution identity/environment → process start → exit/result → target read-back → workload acceptance | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux scheduling/time evidence can establish this proof path: schedule source → scheduler load/enablement → clock + timezone → eligibility/next trigger → execution identity/environment → process start → exit/result → target read-back → workload acceptance | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured host, clock/timezone, scheduler or time-daemon instance, identity/environment, source, trigger/measurement interval or workload scope. Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven scheduling/time boundary: preserve the original timing and execution/source context, capture the adjacent scheduler/process or clock/source state, change only the demonstrated cause, then repeat the original scheduled or time-sensitive workload and regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
Scheduling · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Scheduling |
|---|---|
| Topic path | Scheduling |
| Runtime state | Linux Scheduling is the operational reference for proving when and under which identity/environment a non-interactive job is expected to run, whether the scheduler actually triggered it, and whether the invoked workload completed with the intended effect. |
| Fast checks | - Record scheduler, owner, exact expression/calendar, timezone, expected trigger time and original workload acceptance test. - Read back effective loaded schedule and eligibility including enablement, daemon/timer state and any persistent/catch-up semantics. - Correlate the trigger window with logs/process evidence, effective identity, environment, working directory, command path and exit/status data. - Change one demonstrated cause, then wait for or deliberately reproduce the scheduled path and verify the original target state plus a regression run. |
| Verification chain | schedule source → scheduler load/enablement → clock + timezone → eligibility/next trigger → execution identity/environment → process start → exit/result → target read-back → workload acceptance Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Scheduling is verified only when the exact scheduled path—not merely a manual invocation—is shown to trigger under the intended identity/environment and the original workload result is read back successfully. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |