Courseiva
easyMultiple ChoiceObjective-mapped

XK0-006 Run a backup script every day at 2:00 AM Practice Question

An administrator needs to run a backup script every day at 2:00 AM. The script is located at /usr/local/bin/backup.sh and is executable. The administrator considers several methods to schedule this task. Which method should the administrator use to ensure the script runs at exactly 2:00 AM every day without additional configuration overhead?

⚠ Common exam trap

A common mix-up: candidates confuse cron.daily (which runs daily but at a non-configurable time) with a user-crontab entry, or assume systemd timers are simpler than they actually are, overlooking the extra unit files required.

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

Add the following line to the crontab for root: `0 2 * * * /usr/local/bin/backup.sh`

The correct method is to add a cron job via crontab because cron is the standard Unix/Linux utility for scheduling tasks at specific times. The syntax `0 2 * * *` precisely defines execution at 2:00 AM daily (minute 0, hour 2, every day, every month, every day of week), and the script path is fully qualified. This approach requires no additional configuration overhead beyond a single crontab entry.

Answer analysis

Option-by-option breakdown

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

  • Add the following line to the crontab for root: `0 2 * * * /usr/local/bin/backup.sh`

    Why this is correct

    This crontab entry schedules the script to run at exactly 2:00 AM daily.

  • Append the script path to /etc/rc.local file.

    Why it's wrong here

    rc.local runs at boot, not daily.

  • Place the script in /etc/cron.daily/ directory.

    Why it's wrong here

    cron.daily runs at a system-defined time, not exactly 2:00 AM.

  • Create a systemd timer unit that triggers the script daily at 2:00 AM.

    Why it's wrong here

    This is possible but adds unnecessary complexity compared to cron.

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.