mediumMultiple Choice
XK0-006 Practice Question: Run a script every Monday at 3:00 PM using a…
An administrator wants to run a script every Monday at 3:00 PM using a systemd timer. Which unit file configuration is correct for the timer?
⚠ Common exam trap
CompTIA often tests the distinction between timer unit directives and service unit directives, and the trap here is that candidates mistakenly think `ExecStart=` belongs in the timer file or confuse the `OnCalendar=` syntax with cron-style or human-readable formats like 'weekly Monday 15:00'.
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
✓
OnCalendar=Mon *-*-* 15:00:00
Systemd timer units use the `OnCalendar=` directive with a calendar event format that follows `DayOfWeek Year-Month-Day Hour:Minute:Second`. The pattern `Mon *-*-* 15:00:00` specifies every Monday at 15:00:00, where the asterisks act as wildcards for any year, month, and day. This matches the requirement to run a script every Monday at 3:00 PM.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
OnCalendar=Mon *-*-* 15:00:00
Why this is correct
OnCalendar=Mon *-*-* 15:00:00 satisfies the Monday 3:00 PM schedule using systemd's calendar event syntax, where the weekday field precedes the date and 15:00:00 is 24-hour time. The Persistent=true directive is unnecessary here since the stem specifies no catch-up requirement for missed runs.
- ✗
OnCalendar=weekly Monday 15:00
Why it's wrong here
systemd's OnCalendar does not accept a "weekly" keyword; valid forms are weekday names or expressions such as Mon 15:00. It is tempting because "weekly" reads naturally as a schedule interval, and systemd does support interval-style values like daily or hourly, but those are shorthand rather than the calendar syntax required here.
- ✗
ExecStart=/usr/local/bin/script.sh
Why it's wrong here
ExecStart belongs in the service unit, not the timer unit; a timer requires OnCalendar to define when it fires. It is tempting because ExecStart is the directive that actually launches the script, and administrators familiar with service units reach for it first, but placing it in the .timer file causes systemd to ignore or reject it.
- ✗
OnCalendar=daily 15:00
Why it's wrong here
OnCalendar=daily 15:00 triggers every day at 15:00, not only Mondays, so the script runs seven times weekly. It is tempting because daily is a valid systemd calendar shorthand and 15:00 correctly expresses the time, making it look like a working schedule, but the weekday constraint is missing entirely.
Go deeper
Related to this question
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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.