Interview Prep/Linux/Scheduling, automation and scripting

You inherited a server and need to know every scheduled job on it. Where do you look?

BeginnerScenarioScheduling, automation and scripting
Answer

Situation read → Jobs hide in many places.

What I'd do →

for u in $(cut -d: -f1 /etc/passwd); do sudo crontab -l -u "$u" 2>/dev/null | sed "s/^/$u: /"; done
ls -l /etc/crontab /etc/cron.d/ /etc/cron.{hourly,daily,weekly,monthly}/
systemctl list-timers --all
atq
ls /var/spool/cron/ /var/spool/cron/crontabs/ 2>/dev/null

Why → User crontabs, system crontabs, run-parts directories, systemd timers and at jobs are all separate.

Interview tip → Mentioning systemd timers and anacron shows you know modern distros.

All Linux questions Roadmap: Linux

More on Scheduling, automation and scripting