Use it to add simple periodic scripts, or to find system jobs such as logrotate and package updates.
/etc/cron.*
The /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly directories hold scripts run by run-parts (or anacron) at those intervals; /etc/cron.d holds crontab-format files from packages and admins.
1. ls -l /etc/cron.daily — script executable?
2. Debian: run-parts --test /etc/cron.daily — listed?
3. Name with a dot → rename it.
4. When do they run? grep run-parts /etc/crontab or /etc/anacrontab.
5. Check the cron log after the run.
script placed in cron.<period> → run-parts/anacron runs the directory at the period → script executes
For Scheduling → /etc/cron.*, continue with the first unproven Topic check: Identify which package/unit actually drives the relevant /etc/cron.* directory on this distribution and whether anacron/systemd is involved. If that boundary is healthy, advance to the adjacent check: Check file owner/mode, executable bit, filename filtering, interpreter/shebang and correct system-crontab syntax including user field where applicable. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
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
periodic directory/file → distro driver/run-parts policy → eligibility → user/environment → script/process → exit/output → target read-back → next scheduled execution
Healthy evidence: the correct distro driver owns the directory, eligibility rules accept the file, logs show the intended execution and the target maintenance effect verifies.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Identify which package/unit actually drives the relevant /etc/cron.* directory on this distribution and whether anacron/systemd is involved.
- Check file owner/mode, executable bit, filename filtering, interpreter/shebang and correct system-crontab syntax including user field where applicable.
- Correlate driver logs with the exact script start, identity, environment and stdout/stderr/exit evidence.
- Verify the intended file/service/backup/maintenance result after a controlled run and ensure future periodic execution remains enabled.
Verification chain. periodic directory/file → distro driver/run-parts policy → eligibility → user/environment → script/process → exit/output → target read-back → next scheduled execution
Step 3 Commands Verify boundary
ls /etc/cron.d /etc/cron.daily
run-parts --test /etc/cron.daily
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: wrong filename or mode is silently skipped, /etc/cron.d lacks user field, a systemd timer replaces the assumed cron path, or logs show execution but the script's target effect is absent.
Step 5 Common mistakes Narrow the fault
- Script names with dots skipped by run-parts.
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.
Scripts in cron.daily etc. must be executable and, on Debian, have names without dots (run-parts skips backup.sh). anacron runs them later if the machine was off. Test which would run with run-parts --test /etc/cron.daily.
run-parts --test /etc/cron.daily— scripts that would runsystemctl 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
First determine the distribution's actual driver—cron, anacron, systemd timer or wrapper—and whether the directory is still authoritative. Inspect filename/permission/executable constraints, system crontab user fields and run-parts filtering, then show invocation in logs rather than assuming presence in a directory guarantees execution.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
/etc/cron.* is confirmed only when the distribution's real scheduling driver selects the file, executes it under the intended identity and the resulting maintenance/workload state is verified.
/etc/cron.* owns distribution periodic-directory mechanics. cron/systemd timers own their schedulers; package scripts may own individual jobs; the invoked service/application owns its target state.
In depth
/etc/crontab, /etc/cron.d and the cron.* directories
Besides users' personal crontabs, cron reads system-wide files. The crontab(5) manual page explains that jobs in /etc/crontab and /etc/cron.d/ are system jobs: each line has a user name between the time fields and the command. Packages install their own jobs there. The /etc/cron.hourly, cron.daily, cron.weekly and cron.monthly directories hold plain scripts. On most distributions, /etc/crontab or anacron runs them with run-parts.
The system locations
| Location | Format | Typical content |
|---|---|---|
/etc/crontab | Time fields + user + command | Calls to run-parts for the cron.* directories (Debian) |
/etc/cron.d/ | Time fields + user + command | Package jobs (sysstat, certbot, php) |
/etc/cron.hourly/ etc. | Executable scripts | logrotate, man-db, apt cleanup |
/etc/anacrontab | Period + delay + id + command | Runs the daily, weekly and monthly scripts, catching up after downtime |
/var/spool/cron/ | User crontabs (edit with crontab -e) | Personal jobs |
run-parts rules (Debian family)
run-parts only runs files whose names consist of letters, digits, underscores and hyphens. A script named backup.sh in /etc/cron.daily is silently skipped because of the dot. run-parts --test /etc/cron.daily lists what would actually run.
anacron
Laptops and servers that aren't running at the scheduled time would miss the daily jobs. anacron records when each period last ran, and catches up after boot, with a delay. On RHEL, /etc/cron.d/0hourly runs the hourly directory, and anacron handles daily, weekly and monthly.
host$ grep run-parts /etc/crontab
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.daily; }
host$ ls -l /etc/cron.daily/
-rwxr-xr-x 1 root root 376 Jan 21 2026 apt-compat
-rwxr-xr-x 1 root root 1478 Mar 3 2026 logrotate
-rwxr-xr-x 1 root root 412 Nov 28 14:30 backup.sh
host$ run-parts --test /etc/cron.daily
/etc/cron.daily/apt-compat
/etc/cron.daily/logrotate
host$ sudo mv /etc/cron.daily/backup.sh /etc/cron.daily/backup
host$ cat /etc/anacrontab | grep -v '^#' | grep .
1 5 cron.daily run-parts --report /etc/cron.daily
host$ ls /var/spool/anacron/ && cat /var/spool/anacron/cron.daily
Reading the example
backup.sh doesn't appear in the run-parts --test output, so it would never have run. Renaming it to backup fixes that. The anacron timestamp file shows the date the daily jobs last ran, which helps when a daily job "didn't happen".
Documented example, not captured output.
How it works at runtime
/etc/cron.* is part of Scheduling → /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.
Topic-specific state model. /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.
Interpretation rule. - A script present in /etc/cron.daily ≠ it is eligible under run-parts naming/permission rules.
/etc/cron.dsyntax ≠ per-user crontab syntax; system entries usually include an explicit user field.- A distro still ships
/etc/cron.*≠ cron directly drives every directory; systemd/anacron may mediate execution. - Executable file launched ≠ script completed or produced the intended target state.
Quick reference
System cron directories:
| Location | Format |
|---|---|
/etc/crontab | Full syntax with user field |
/etc/cron.d/* | Same as /etc/crontab (packages, automation) |
/etc/cron.hourly|daily|weekly|monthly/ | Executable scripts run by run-parts/anacron |
/var/spool/cron/ (crontabs/) | Per-user crontabs (edit with crontab -e) |
# /etc/cron.d/app-cleanup
0 3 * * * app /opt/app/bin/cleanup --days 30
run-parts --test /etc/cron.daily
Scripts in cron.daily must be executable and on Debian must not contain dots in their names (run-parts ignores them).
Limits and how it fails
Primary failure point. /etc/cron.* is confirmed only when the distribution's real scheduling driver selects the file, executes it under the intended identity and the resulting maintenance/workload state is verified.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. /etc/cron.* owns distribution periodic-directory mechanics. cron/systemd timers own their schedulers; package scripts may own individual jobs; the invoked service/application owns its target state.
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 → /etc/cron.*. 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
/etc/cron.* operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for /etc/cron.*.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | /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. | 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 | periodic directory/file → distro driver/run-parts policy → eligibility → user/environment → script/process → exit/output → target read-back → next scheduled execution | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | /etc/cron.* is proven only when the distribution's real scheduling driver selects the file, executes it under the intended identity and the resulting maintenance/workload state is verified. | 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: periodic directory/file → distro driver/run-parts policy → eligibility → user/environment → script/process → exit/output → target read-back → next scheduled execution | 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. /etc/cron.* is proven only when the distribution's real scheduling driver selects the file, executes it under the intended identity and the resulting maintenance/workload state is verified. | 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. |
/etc/cron.* · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | /etc/cron.* |
|---|---|
| Topic path | Scheduling → /etc/cron.* |
| Runtime state | /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. |
| Fast checks | - Identify which package/unit actually drives the relevant /etc/cron.* directory on this distribution and whether anacron/systemd is involved. - Check file owner/mode, executable bit, filename filtering, interpreter/shebang and correct system-crontab syntax including user field where applicable. - Correlate driver logs with the exact script start, identity, environment and stdout/stderr/exit evidence. - Verify the intended file/service/backup/maintenance result after a controlled run and ensure future periodic execution remains enabled. |
| Verification chain | periodic directory/file → distro driver/run-parts policy → eligibility → user/environment → script/process → exit/output → target read-back → next scheduled execution 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 | /etc/cron.* is proven only when the distribution's real scheduling driver selects the file, executes it under the intended identity and the resulting maintenance/workload state is verified. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |