nerdexam
LPI

102-500 · Question #145

How is the file format of /etc/crontab different from a normal crontab file? (Select TWO correct answers)

The correct answer is B. A normal crontab file must be installed with the crontab command. D. The /etc/crontab file has a user field for commands. B and D are correct because they identify the two structural/workflow differences between /etc/crontab and user crontab files. B is correct: User crontab files must be installed using crontab -e or crontab <file> - you cannot simply drop a file in place. The cron daemon reads…

Administrative Tasks

Question

How is the file format of /etc/crontab different from a normal crontab file? (Select TWO correct answers)

Options

  • AThe /etc/crontab file can specify a year field.
  • BA normal crontab file must be installed with the crontab command.
  • CA normal crontab file allows for environment variable substitution.
  • DThe /etc/crontab file has a user field for commands.

How the community answered

(28 responses)
  • A
    18% (5)
  • B
    75% (21)
  • C
    7% (2)

Explanation

B and D are correct because they identify the two structural/workflow differences between /etc/crontab and user crontab files.

B is correct: User crontab files must be installed using crontab -e or crontab <file> - you cannot simply drop a file in place. The cron daemon reads user crontabs from a spool directory (e.g., /var/spool/cron/), and the crontab command is the gatekeeper that places them there correctly.

D is correct: /etc/crontab (the system-wide crontab) has an extra field between the time specification and the command - the username that the command runs as (e.g., root, www-data). User crontab files omit this field because the owner of the crontab implicitly determines the run user.

Why the distractors are wrong:

  • A: Neither /etc/crontab nor user crontabs support a year field - cron's time specification is always five fields (minute, hour, day, month, weekday).
  • C: Environment variable substitution (e.g., SHELL=, PATH=) is actually supported in both /etc/crontab and user crontabs, so this is not a distinguishing difference.

Memory tip: Think "system = extra column, extra process" - /etc/crontab needs an extra user column (because it's system-wide), and normal crontabs need the extra crontab command to install them.

Topics

#crontab#cron scheduling#system configuration#administrative tools

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice