hardMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A sysadmin is tasked with creating a script that…
A sysadmin is tasked with creating a script that will run only on weekdays at 9:00 AM using cron. The script should not run on holidays. Which approach best achieves this requirement?
⚠ Common exam trap
CompTIA often tests the misconception that cron can directly handle holidays, when in fact cron has no concept of holidays and requires external logic (like a script check) to skip them.
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
✓
Use cron to run at 9:00 on weekdays, and include a test in the script that checks a holiday list
Cron can schedule the script to run at 9:00 AM on weekdays using the day-of-week field (e.g., `0 9 * * 1-5`), and the script itself can check a holiday list (e.g., a file or API) to exit early on holidays. This approach cleanly separates scheduling from holiday logic, avoiding cron's lack of built-in holiday awareness.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use systemd timers with a calendar specification that excludes holidays
Why it's wrong here
systemd timer calendar expressions cannot exclude arbitrary holidays without complex custom logic.
- ✓
Use cron to run at 9:00 on weekdays, and include a test in the script that checks a holiday list
Why this is correct
This ensures the script runs on weekdays but can skip holidays by checking within the script.
- ✗
Use cron to run at 9:00 every day, and include conditional logic to abort on weekends
Why it's wrong here
This runs every day and adds unnecessary execution on weekends; it's better to limit cron to weekdays.
- ✗
Use `at` to schedule the job individually each weekday morning
Why it's wrong here
Using `at` is not sustainable for recurring scheduling.
Go deeper
Related to this question
About these practice questions
This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.