hardMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A system administrator notices that a cron job…
A system administrator notices that a cron job runs every 5 minutes but should run only on weekdays. The current crontab entry is: */5 * * * * /usr/local/bin/script.sh. Which change to the time fields will restrict execution to Monday through Friday?
⚠ Common exam trap
Test-takers frequently confuse the day-of-week field with the day-of-month field, or incorrectly assume that `1-5` excludes weekends without realizing that cron's day-of-week numbering starts with Sunday as 0, so `1-5` correctly maps to Monday-Friday.
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
✓
*/5 * * * 1-5 /usr/local/bin/script.sh
The fifth field in a crontab entry specifies the day of the week, where 1 represents Monday and 5 represents Friday. By setting this field to `1-5`, the cron job will only execute on weekdays, while the `*/5` in the minute field ensures it still runs every 5 minutes. The other fields remain as `*` to allow execution at any hour and any day of the month.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
*/5 9-17 * * 1-5 /usr/local/bin/script.sh
Why it's wrong here
Limits hours to 9-17, not the requirement.
- ✗
*/5 * * * 1-6 /usr/local/bin/script.sh
Why it's wrong here
1-6 includes Saturday (6).
- ✓
*/5 * * * 1-5 /usr/local/bin/script.sh
Why this is correct
Runs every 5 minutes, every hour, every day of month, every month, on weekdays (1-5).
- ✗
5 * * * 1-5 /usr/local/bin/script.sh
Why it's wrong here
Runs once per hour at minute 5, not every 5 minutes.
Go deeper
Related to this question
Learn chapter
Process Management and System Monitoring
Key term
crontab
Crontab is a time-based job scheduler in Unix-like operating systems that allows users to automate the execution of scripts or commands at specified intervals.
Key term
cron
Cron is a time-based job scheduler in Unix-like operating systems that automatically runs commands or scripts at specified dates and times.
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.