Test run-parts dry run

List which scripts would execute without running them; debugging cron.daily

run-parts --test /etc/cron.daily

tool
cron8 commands
tags
crondebugtroubleshooting

More cron commands

  • systemd-run --on-calendar='*-*-* 03:00:00' --unit=backup /opt/backup.sh

    modern: transient OnCalendar timer with logs/retries; replaces a crontab line

  • at now + 1 hour <<< 'systemctl restart nginx'

    Schedule a single deferred command; inspect queue with atq, cancel with atrm

  • batch <<< '/opt/heavy-reindex.sh'

    Run only when load avg drops below 1.5; note: atd must be running

  • crontab -l -u <name> 2>/dev/null || echo 'no crontab'

    Inspect a service account's jobs as root; note: -u needs root or sudo

  • ( crontab -l 2>/dev/null; echo '@reboot /usr/local/bin/warmup.sh' ) | crontab -

    Append @reboot job idempotently; note: no networking guarantee at boot, use systemd for deps

all 8 cron commands