Interview Prep/Linux/Scheduling, automation and scripting

A scheduled job must only run if the previous job in a chain succeeded. How do you build job dependencies on a single host?

AdvancedScenarioScheduling, automation and scripting
Answer

Situation read → Chain with systemd dependencies instead of guessing times.

What I'd do →

  • extract.service (oneshot) with a timer.
  • transform.service with:
[Unit]
Requires=extract.service
After=extract.service
  • Or in extract.service: ExecStartPost=/usr/bin/systemctl start --no-block transform.service (only runs on success), plus OnFailure=alert@%n.service.

Why → Time-based chains ("extract at 1:00, transform at 2:00") break the first time extract runs long.

Interview tip → Above a few steps, say you'd move it to Airflow or a CI pipeline for visibility.

All Linux questions Roadmap: Linux

More on Scheduling, automation and scripting