Courseiva
GNU and Unix Commands →hardMultiple Choice

LPIC-1 GNU and Unix Commands Practice Question

A developer needs to run a script named `backup.sh` every day at 02:30 using the system-wide cron facility. The system uses a traditional cron daemon and the file `/etc/crontab` contains a `SHELL` and `PATH` line. Which entry in `/etc/crontab` correctly schedules the script to run as user 'backup'?

⚠ Common exam trap

The trap here is assuming the same crontab syntax applies to both `/etc/crontab` and user crontabs, when in fact the system-wide file requires an extra username field.

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

✓

30 2 * * * backup /usr/local/bin/backup.sh

The system-wide `/etc/crontab` file has a distinct format that includes a username field before the command. The correct syntax is: minute hour day-of-month month day-of-week user command. The entry `30 2 * * * backup /usr/local/bin/backup.sh` schedules the script at 02:30 daily and runs it as the 'backup' user. Entries without the user field are valid only in per-user crontabs created with `crontab -e`.

Answer analysis

Option-by-option breakdown

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

  • ✗

    30 2 * * * root run-parts /usr/local/bin/backup.sh

    Why it's wrong here

    `run-parts` expects a directory, not a single script file. It will attempt to execute every executable file inside the given path. Since `/usr/local/bin/backup.sh` is a file, `run-parts` will fail or do nothing. Additionally, this entry runs as root rather than the requested 'backup' user, which does not meet the scenario requirement.

  • ✓

    30 2 * * * backup /usr/local/bin/backup.sh

    Why this is correct

    The system-wide `/etc/crontab` file includes a user field between the time/date fields and the command. The format is minute hour day-of-month month day-of-week user command. `30 2 * * *` means 02:30 every day, `backup` is the user to run as, and the absolute path to the script is given. This is the correct syntax for `/etc/crontab`.

  • ✗

    30 2 * * * backup /bin/sh /usr/local/bin/backup.sh

    Why it's wrong here

    While this entry includes the user field and runs the script via `/bin/sh`, it is unnecessarily explicit and may cause issues if the script relies on a different interpreter specified by its shebang. The standard and correct form is to invoke the script directly, relying on its executable bit and shebang. The extra `/bin/sh` is not required and can mask interpreter requirements.

  • ✗

    30 2 * * * /usr/local/bin/backup.sh

    Why it's wrong here

    This entry omits the user field. In `/etc/crontab`, the sixth field must be the username; without it, cron will interpret `/usr/local/bin/backup.sh` as the user and fail to find a matching command. The script would not run. This format is valid only in user crontabs (e.g., `crontab -e`), not in the system-wide file.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 402 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official LPI exam blueprint

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.