easyMultiple Choice
XK0-006 Add a script to be executed daily Practice Question
Exhibit
Refer to the exhibit. ``` $ ls -l /etc/cron.daily/ total 8 -rwxr-xr-x 1 root root 245 Mar 10 10:00 logrotate -rwxr-xr-x 1 root root 123 Mar 10 10:00 syscheck ```
An administrator needs to add a script to be executed daily. The script is placed at /etc/cron.daily/myscript. After placing the script, it does not run. Based on the exhibit, what is the most likely issue?
⚠ Common exam trap
Many candidates assume ownership or the cron daemon status is the issue, but the specific requirement for the executable bit on scripts in cron.daily directories is a subtle but frequently tested detail.
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
✓
The script is not executable
Scripts placed in /etc/cron.daily/ are executed by run-parts, which requires files to have the executable bit set. Without the execute permission (e.g., chmod +x), the script is skipped entirely, even if it is owned correctly and the cron daemon is active.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The script is owned by the wrong user
Why it's wrong here
Ownership does not determine whether run-parts executes a /etc/cron.daily script; the execute permission bit does. Ownership tempts because incorrect ownership blocks other scheduled tasks, yet here the exhibit points to a missing execute bit, which prevents execution regardless of which user owns the file.
- ✗
The cron daemon is not running
Why it's wrong here
A stopped cron daemon would prevent every scheduled job from running, not just this one script, and the exhibit shows other jobs functioning. It tempts because a dead daemon is a classic cause of silent scheduling failure, but the evidence isolates the fault to this file's permissions.
- ✓
The script is not executable
Why this is correct
Cron silently skips files in /etc/cron.daily that lack the execute bit, so the job never runs. Setting the executable permission with chmod +x allows run-parts to invoke the script, resolving the failure without altering the schedule or path.
- ✗
The script is not listed in /etc/crontab
Why it's wrong here
Scripts in /etc/cron.daily are run by run-parts, which reads the directory directly; /etc/crontab does not need individual entries for them. The option tempts because /etc/crontab does schedule jobs, but those are explicit user-and-command lines, not directory-based daily runs.
- ✗
Anacron is not installed
Why it's wrong here
Anacron's absence does not stop cron from executing /etc/cron.daily entries; cron itself runs them, and anacron merely catches up missed jobs on systems not running continuously. It tempts because anacron does handle daily jobs, but the exhibit's failure concerns the script's own attributes, not the scheduler's presence.
Go deeper
Related to this question
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.
Key term
chmod
chmod is a command in Linux and Unix-like operating systems used to change the permissions (read, write, execute) of a file or directory.
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.