Courseiva

LPIC-1 Shells, Scripting and Data Management Practice Question

A user needs to schedule a backup script to run every weekday at 2:00 AM. Which command should they use to set up this recurring job?

⚠ Common exam trap

A common mix-up: candidates confuse `at` (one‑time scheduling) with `cron` (recurring scheduling), or think `sleep` in a loop can replace cron, but cron is the only correct tool for fixed recurring jobs in Linux.

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

✓

crontab -e and add a line

The cron daemon is the standard Linux tool for scheduling recurring jobs at specific times. Using `crontab -e` allows the user to edit their personal crontab file and add a line like `0 2 * * 1-5 /path/to/backup.sh` to run the script every weekday (Monday through Friday) at 2:00 AM.

Answer analysis

Option-by-option breakdown

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

  • ✗

    sleep 3600 && ./backup.sh

    Why it's wrong here

    Chaining sleep with && runs the script once after a fixed delay, not on a recurring weekday schedule; it also blocks the shell. It suits a one-off delayed execution within a session, but cron is required for repeating jobs.

  • ✓

    crontab -e and add a line

    Why this is correct

    crontab -e opens the user's crontab for editing, where a schedule such as 0 2 * * 1-5 runs the backup script at 02:00 Monday through Friday. This satisfies the weekday-only, recurring requirement, unlike at or systemd timers for one-off jobs.

  • ✗

    at -f backup.sh 2:00

    Why it's wrong here

    The at command schedules a one-off job, not a recurring weekday schedule; cron with a weekday field is required. It is tempting because at does accept a time argument and script file, and would be correct for a single backup run at 2:00 AM on one specific date.

  • ✗

    batch

    Why it's wrong here

    batch queues a job to run once when system load drops below a threshold, at no fixed time and without recurrence. It fits deferring a heavy one-off task, not a weekday 2:00 AM schedule, which requires a cron entry.

About these practice questions

This LPIC-1 question is part of Courseiva's 402-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 LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.