nerdexam
CompTIA

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.

Essential System Services

Question

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

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)
  • A
    3% (1)
  • B
    94% (33)
  • C
    3% (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.

AThe /etc/crontab file can specify a year field.

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.

BA normal crontab file must be installed with the crontab command.Correct

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.

CA normal crontab file allows for environment variable substitution.

Both `/etc/crontab` and normal user crontab files allow for environment variable substitution and definition within their respective formats.

DThe /etc/crontab file has a user field for commands.Correct

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

#crontab#scheduled tasks#system-wide cron#user cron

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice