LX0-104 · Question #520
How is the file format of /etc/crontab different from a normal crontab file? (Select TWO).
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.. The /etc/crontab file differs from a normal user crontab in that it includes a user field for specifying who executes the command, and user crontabs must be installed via the crontab command.
Question
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
(35 responses)- A3% (1)
- B94% (33)
- C3% (1)
Why each option
The `/etc/crontab` file differs from a normal user crontab in that it includes a user field for specifying who executes the command, and user crontabs must be installed via the `crontab` command.
Standard crontab file formats, including `/etc/crontab`, do not typically include a year field; scheduling is based on minute, hour, day of month, month, and day of week.
Normal user crontab files, stored typically under `/var/spool/cron/tabs/`, are managed and installed using the `crontab -e` command, which ensures proper syntax checking and installation for the cron daemon.
Both `/etc/crontab` and normal user crontab files allow for environment variable substitution and definition within their respective formats.
The `/etc/crontab` file, being a system-wide crontab, requires an additional field to specify the username under which the scheduled command should be executed, unlike user-specific crontabs where the user is implicit.
Concept tested: Crontab file formats and system-wide vs user-specific
Source: https://man7.org/linux/man-pages/man5/crontab.5.html
Topics
Community Discussion
No community discussion yet for this question.