Courseiva
easyMultiple SelectObjective-mapped

XK0-006 Practice Question: Ensure a critical monitoring script runs every…

An administrator wants to ensure a critical monitoring script runs every day at 2 AM and sends output to a log file. Which THREE items are essential in the crontab entry? (Select THREE.)

⚠ Common exam trap

CompTIA often tests the misconception that MAILTO is required for logging output, when in fact output redirection (e.g., >> /var/log/script.log 2>&1) is what sends output to a file, and MAILTO is only for email delivery.

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

SHELL=/bin/bash

The SHELL variable in a crontab entry defines which shell interpreter is used to execute the cron job. By default, cron uses /bin/sh, but setting SHELL=/bin/bash ensures that bash-specific syntax, aliases, and features (such as [[ ]] or source) are available for the monitoring script. Without this, the script might fail if it relies on bash extensions.

Answer analysis

Option-by-option breakdown

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

  • SHELL=/bin/bash

    Why this is correct

    If the script uses bash-specific features, setting SHELL is required; otherwise, cron uses /bin/sh.

  • RUNLEVEL=3

    Why it's wrong here

    RUNLEVEL is not a cron-related variable; it is used by init systems.

  • 0 2 * * * /usr/local/bin/script.sh

    Why this is correct

    This is the cron schedule and command; it is essential.

  • MAILTO=admin@example.com

    Why it's wrong here

    MAILTO is optional; the output can be redirected to a log file instead.

  • PATH=/usr/local/bin:/usr/bin

    Why this is correct

    A proper PATH ensures commands in the script are found without absolute paths.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 979 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 →

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.