Affected versions: Debian 11

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Scheduled maintenance and business automation tasks fail silently.

Environment & Reproduction

Usually after package changes, wrong file perms, or PATH assumptions.

systemctl status cron
crontab -l
ls -l /etc/cron.*

Root Cause Analysis

Cron daemon disabled, malformed crontab entries, or missing environment variables.

Quick Triage

Verify scheduler service, logs, and user crontab syntax.

systemctl is-enabled cron
sudo journalctl -u cron -n 120 --no-pager
crontab -l

Step-by-Step Diagnosis

Validate command paths and execution context used by cron.

which bash python3
cat /etc/crontab
run-parts --test /etc/cron.daily
Illustrative mockup for debian-11 — terminal_or_shell
Checking cron daemon and job definitions — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Enable cron, fix crontab syntax, and use absolute command paths.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo systemctl enable --now cron
(crontab -l; echo '*/5 * * * * /usr/bin/bash /opt/scripts/healthcheck.sh >> /var/log/healthcheck.log 2>&1') | crontab -
sudo systemctl restart cron
Illustrative mockup for debian-11 — log_or_config
Fixing cron syntax and runtime environment — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use systemd timers for stricter dependency and logging control.

systemctl list-timers --all
sudo systemctl enable --now myjob.timer

Verification & Acceptance Criteria

Scheduled task executes on time and writes expected output.

grep CRON /var/log/syslog | tail -n 30
tail -n 30 /var/log/healthcheck.log
systemctl is-active cron

Rollback Plan

Revert to previous crontab from backup if new entry is faulty.

crontab -l > /var/tmp/crontab.bak.$(date +%s)
crontab /var/tmp/crontab.bak.

Prevention & Hardening

Lint cron entries and centralize script logging and alerting.

run-parts --test /etc/cron.hourly
crontab -l

Can overlap with locale issues, missing PATH, and permission denials.

Related tutorial: View the step-by-step tutorial for Debian 11.

View all Debian 11 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Debian cron and systemd timer operational guidance.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.