cron
8 commands
8 shown
Dump another user's crontab
Inspect a service account's jobs as root; note: -u needs root or sudo
crontab -l -u <name> 2>/dev/null || echo 'no crontab'
Run job at boot
Append @reboot job idempotently; note: no networking guarantee at boot, use systemd for deps
( crontab -l 2>/dev/null; echo '@reboot /usr/local/bin/warmup.sh' ) | crontab -
Pipe cron output to syslog
Tag stdout+stderr into journald/syslog instead of mailing root
*/5 * * * * /opt/job.sh 2>&1 | /usr/bin/logger -t job
MAILTO and PATH header
Cron PATH is minimal; set PATH/MAILTO at top or jobs fail silently
crontab - <<'EOF'
MAILTO=ops@example.com
PATH=/usr/local/bin:/usr/bin:/bin
0 3 * * * backup.sh
EOF
Test run-parts dry run
List which scripts would execute without running them; debugging cron.daily
run-parts --test /etc/cron.daily
systemd timer alternative
modern: transient OnCalendar timer with logs/retries; replaces a crontab line
systemd-run --on-calendar='*-*-* 03:00:00' --unit=backup /opt/backup.sh
One-shot job with at
Schedule a single deferred command; inspect queue with atq, cancel with atrm
at now + 1 hour <<< 'systemctl restart nginx'
Defer until load is low
Run only when load avg drops below 1.5; note: atd must be running
batch <<< '/opt/heavy-reindex.sh'
no commands match