Courseiva

XK0-006 Automation, Orchestration, and Scripting Practice Question

A Linux administrator needs to run a recurring backup script located at /usr/local/bin/backup.sh every day at 02:30. The system uses systemd and the administrator wants the job scheduled through a systemd timer rather than cron. Which combination of unit files must be created and enabled?

⚠ Common exam trap

The trap here is assuming the .service unit must be enabled to make the schedule work, when it is actually the .timer unit that must be enabled and started.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

A .timer unit with OnCalendar=*-*-* 02:30:00 and a matching .service unit, then enable and start the .timer unit.

A systemd timer requires two cooperating units: a .timer unit that defines the schedule via OnCalendar= and a same-named .service unit that defines what to execute. To activate the schedule you enable and start the .timer unit, not the service. At each matching calendar point systemd triggers the associated service, which runs the ExecStart= command pointing at the backup script.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    A single .service unit containing OnCalendar=*-*-* 02:30:00 in its [Service] section, then enable and start that unit.

    Why it's wrong here

    OnCalendar= is a valid directive only inside the [Timer] section of a .timer unit. Placing it in the [Service] section of a .service unit is invalid; systemd will report an unknown-key error. A service unit describes what to run, not when to run it, so this approach cannot produce a recurring 02:30 schedule.

  • ✓

    A .timer unit with OnCalendar=*-*-* 02:30:00 and a matching .service unit, then enable and start the .timer unit.

    Why this is correct

    A systemd timer is driven by the OnCalendar= expression, and systemd activates the same-named .service unit when the timer elapses. Enabling and starting the .timer unit registers the schedule with systemd. The .service unit contains the ExecStart= line that actually invokes /usr/local/bin/backup.sh, so this pairing correctly delivers a daily 02:30 execution.

  • ✗

    A .timer unit with OnCalendar=*-*-* 02:30:00 and a matching .service unit, then enable and start the .service unit.

    Why it's wrong here

    Enabling the .service unit makes systemd start the backup script at boot but never arms the timer, so the 02:30 schedule never activates. The .timer unit is the component that registers the schedule with systemd; it must be enabled and started for the calendar expression to take effect. The pairing is correct but the enablement target is wrong.

  • ✗

    A .timer unit with OnBootSec=02:30 and a matching .service unit, then enable and start the .timer unit.

    Why it's wrong here

    OnBootSec= is a monotonic timer that fires a fixed interval after boot, not a wall-clock time. Setting it to 02:30 means 2 minutes 30 seconds after the system starts, which is unrelated to the requested 02:30 daily run. Reaching a specific time of day requires the calendar-based OnCalendar= directive instead.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.