Courseiva
easyMultiple ChoiceObjective-mapped

XK0-006 Practice Question: Refer to the exhibit

Exhibit

$ crontab -l
0 2 * * * /usr/local/bin/cleanup.sh

Refer to the exhibit. A system administrator notices that the cleanup script runs at 2:00 AM every day but sometimes does not execute. The log shows no output from the script. Which step should be taken to investigate?

⚠ Common exam trap

It's easy for candidates to assume 'no output' means the script didn't run, leading them to check cron execution (Option B) or permissions (Option A), when the real issue is that the script runs but fails silently, requiring output redirection to diagnose the failure.

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

Change the script to log output to a file.

The script runs but produces no log output, indicating it may be failing silently. Redirecting the script's stdout and stderr to a file (e.g., `>> /var/log/cleanup.log 2>&1`) captures error messages and output, allowing the administrator to see why the script sometimes does not execute or fails. This is the most direct way to diagnose a cron job that runs but yields no visible results.

Answer analysis

Option-by-option breakdown

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

  • Verify that the script is executable by the root user.

    Why it's wrong here

    This is a basic check but does not explain intermittent failures or lack of output.

  • Check the syslog for cron execution messages.

    Why it's wrong here

    Syslog shows cron job starts but not script output or errors.

  • Add a MAILTO directive to the crontab.

    Why it's wrong here

    MAILTO sends email with output, but only if output is generated; still not captured if script silently fails.

  • Change the script to log output to a file.

    Why this is correct

    Redirecting stdout and stderr to a file allows administrators to see error messages and diagnose failures.

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 →

How Courseiva writes practice questions · Editorial policy

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.