102-500 · Question #207
Which of the following fields are available in both the global /etc/crontab file as well as in user- specific crontab files? (Select TWO correct answers)
The correct answer is B. Minute D. Command. See the full explanation below for the reasoning.
Question
Options
- AYear
- BMinute
- CUsername
- DCommand
How the community answered
(30 responses)- A23% (7)
- B70% (21)
- C7% (2)
Community Discussion
7The correct answers are B (Minute) and D (Command). Every crontab entry, whether system-wide in /etc/crontab or in a user crontab managed by crontab -e, uses the same five time fields (minute, hour, day of month, month, day of week) followed by the command to run. The LPIC-1 objective 107.2 and the cron(8) / crontab(5) man pages are explicit on this point. The Username field (C) appears only in /etc/crontab and system drop-in files under /etc/cron.d, because the system crontab needs to know which user to run the job as, while user crontabs already have that context from the file ownership. Year (A) is not a crontab field at all in the standard Vixie cron implementation used on Linux, period, so eliminate that immediately.
Hiroshi nailed the core distinction, and it is worth adding that some extended cron implementations like fcron and certain systemd-based schedulers do support a Year field, so candidates should know that LPIC-1 specifically tests the Vixie cron behavior where Year is absent.
Think of a crontab like a shift schedule: every version needs the "when" (Minute) and the "what to do" (Command), so B and D are your two common fields. Year is the tempting trap since cron does not have a year field at all in either format, and Username is the extra column only the system-wide file adds.
I was thrown off by C at first because I kept thinking, well, the system crontab obviously has a Username field so maybe that shows up in user crontabs too, but then I remembered that user crontabs drop the Username field entirely since the cron daemon already knows who owns the file. The two fields that appear in both are Minute (part of the five time fields that both formats share) and Command (the whole point of the entry, always the last field regardless of which crontab you are in).
Good way to lock that in, and a quick shortcut worth adding is to think of the system crontab like a shared apartment building maintenance log where every line needs a Name column so the super knows whose job it is, while a user crontab is your own personal sticky note on your own door, so the daemon already knows it belongs to you from the file ownership itself and there is no signature line printed on it at all.
I am going with A and B on this one, and here is my reasoning. The cron time specification exists in both /etc/crontab and user crontabs, and that specification covers minute, hour, day of month, month, and year, all of which appear in both file types. The username field only shows up in /etc/crontab because the system needs to know which account to run the job under, whereas user crontabs are already scoped to a specific user so that column is omitted entirely. Year is part of the scheduling syntax you write in either context, so it clears the "available in both" test just as cleanly as minute does.
Sara, the cron time specification actually uses five fields, not six, covering minute, hour, day of month, month, and day of week, with no year field at all, so year fails the "available in both" test entirely. The field that appears only in /etc/crontab is the username, which is option D, making the correct pair B and D.