You meant to edit your personal crontab but typed `crontab -r`. What happened?
LPIC-1 Exam 102-500, objective 107. Administrative tasks easy
Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.
Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
The options
Not correct The crontab was reloaded from disk and nothing changed
Wrong. There is no reload option; cron notices changes to a crontab by itself. -r is not a reload.
Not correct The crontab was printed to standard output
Wrong. That is -l (list), which writes the current crontab to standard output without modifying it.
Correct Your entire crontab was deleted, without a confirmation prompt
Correct. -r removes the invoking user's crontab file outright. Standard cron asks nothing, which is why -r sits next to -e on the keyboard as a well-known hazard. Some implementations offer -i to prompt first.
Not correct The crontab was restored from the most recent backup copy
Wrong. cron keeps no backups or version history of crontabs at all. Recovering a deleted crontab means retyping it or restoring the spool file from a system backup.
Why
crontab's main options are -e to edit in $EDITOR or $VISUAL, -l to list, -r to remove, and -u USER to act on another user's crontab (root only). A common defensive habit is `crontab -l > ~/crontab.bak` before editing.
Where this comes from
- Cited
- LPI exam objective 107.2
- What it says
- Use the crontab command to create, list and remove cron jobs.
Practise this
Reading one question is not practice. The trainer will draw a short set from objective 107 and space the ones you get wrong.
More questions on this objective
- The account alice already belongs to the supplementary groups audio and video. You must additionally put her in the group developers while keeping her existing memberships. Which command does that? machine-checked
- A departing employee's account bob must be deleted together with his home directory and mail spool. Which command does all of that in one step? machine-checked
- You want every newly created account to start with a company-standard .bashrc already in its home directory. Where do you place that file? machine-checked
- On a host whose accounts come partly from local files and partly from a directory service, `grep alice /etc/passwd` returns nothing even though `id alice` works. Which command shows alice's account entry the way the system itself resolves it? machine-checked
- Policy says passwords must be changed at least every 90 days, and the account carol must comply. Which command sets that maximum password age? machine-checked
- A line in /etc/group reads `developers:x:1500:alice,bob`. What does the final field contain? machine-checked