Day 13: Cron jobs and scheduling
This topic matters because it deals with proving which scheduled jobs really run, who owns them, and what command they launch using Bash and the native Linux tooling already on the box.
The pattern
#!/usr/bin/env bash
set -euo pipefail
systemctl list-timers --all --no-pager
journalctl -u cron --since '1 day ago' | tail -40
I keep the shell layer thin and obvious, then let the actual host commands produce the evidence. That gives me clear cron and systemd timer inventories with the command, user, and next run time visible with far less operational risk than a giant opaque script.
The concrete evidence I want to preserve usually comes from /etc/cron.*, crontab -l, systemctl list-timers, journalctl, and run logs under /var/log. If a tool says a control is healthy, I want the line, path, or command output that justified that statement right next to it.
The Bash habit worth keeping
Use strict defaults, name the files and services you touch, and make inconclusive checks visible. Bash is still a strong security tool when it behaves like a disciplined operator note rather than a magic trick.
Top comments (0)