Courseiva
easyMultiple Choice

XK0-006 Practice Question: A junior administrator is asked to automate the…

A junior administrator is asked to automate the backup of a configuration file every night at 11 PM. The script /usr/local/bin/backup.sh already exists. Which command should the administrator run to schedule this task?

⚠ Common exam trap

A common mix-up: candidates confuse `at` (for one-time tasks) with `cron` (for recurring tasks), or assume `systemctl start` can create a timer on the fly without a pre-existing timer unit file.

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

✓

echo "0 23 * * * /usr/local/bin/backup.sh" | crontab -

The `crontab -` command reads from standard input and installs the cron job. The line `0 23 * * * /usr/local/bin/backup.sh` specifies that the script should run at 23:00 (11 PM) every day, matching the requirement exactly. This is the standard method for scheduling recurring tasks in Linux using cron.

Answer analysis

Option-by-option breakdown

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

  • ✗

    systemctl start backup.timer

    Why it's wrong here

    systemctl start backup.timer only starts an existing systemd timer unit immediately; it neither creates the unit nor schedules a recurring 23:00 run. A systemd timer would be correct if a matching .timer and .service pair already existed and were enabled. Here the task requires a cron entry instead.

  • ✗

    at 23:00 /usr/local/bin/backup.sh

    Why it's wrong here

    at schedules a command to run once at a specified time, so it would execute the backup a single time at 23:00 rather than every night. It is tempting because the time syntax matches, but at is designed for one-off jobs. Recurring nightly execution requires a cron entry.

  • ✓

    echo "0 23 * * * /usr/local/bin/backup.sh" | crontab -

    Why this is correct

    Piping the schedule into `crontab -` installs it as the invoking user's crontab, and the five fields `0 23 * * *` fire the existing script daily at 23:00, satisfying the 11 PM requirement without editing files manually.

  • ✗

    nohup /usr/local/bin/backup.sh &

    Why it's wrong here

    nohup runs the script immediately in the background and detaches it from the terminal; it sets no schedule at all. It is tempting because it keeps a process running after logout, which suits long jobs started now. Recurring execution at 23:00 nightly needs a cron entry, not nohup.

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.