Scheduled Jobs Capstone: Repair a Broken systemd Timer and cron Entry
ExpertRHCSA Prep40-60 minA maintenance job is scheduled two ways — a systemd timer (plus its service) and an /etc/cron.d entry — and both are broken, six ways in total. Repair them all. Grading validates with systemd-analyze calendar plus unit/cron/file state; nothing is actually run. See /root/brief.txt for the exact paths.
timer + service:
1. Invalid schedule — the timer's OnCalendar expression isn't a valid time, so it would never fire. Set a valid schedule (check any candidate with systemd-analyze calendar '<expr>').
2. Not persistent — a run missed while the machine was down is silently skipped instead of catching up on the next boot. Make the timer persistent.
3. Not enabled — the timer isn't enabled, so no timers.target.wants symlink exists and it won't start on boot.
4. Wrong `ExecStart` — the paired service points at a script that doesn't exist; aim it at the real maintenance script.
cron:
5. Missing user — /etc/cron.d lines require a user field between the schedule and the command (unlike a user crontab). This line omits it, so it's invalid.
script:
6. Not executable — the maintenance script can't be run as a program in its current state, so neither scheduler could execute it.
- Write a valid OnCalendar expression and verify it with systemd-analyze calendar
- Make a timer persistent and enable it so it runs on boot
- Point a service unit at the correct ExecStart
- Write a correct /etc/cron.d line including the required user field
- Understand the two scheduling mechanisms and their distinct correctness rules
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
