102-500 practice question 5 of 30

Where are user specific crontabs stored?

Full set: 233 questions
Answer options
A: In the database file /etc/crontab.db which is shared by all users.
B: As individual per-user files within /var/spool/cron. Correct answer
C: As individual per-user files in /etc/cron.user.d.
D: In the .crontab file in the user's home directory.
E: In the file /var/cron/user-crontab which is shared by all users.
Correct Answer:
B. As individual per-user files within /var/spool/cron.
Explanation

User-specific crontabs, managed via the crontab command, are stored as individual files in a spool directory. The standard location on most Linux systems is /var/spool/cron. Each file is named after the user account it belongs to. This separation ensures that users can only edit their own scheduled tasks and cannot interfere with system-wide cron jobs or the jobs of other users. Direct editing of these files is discouraged; the crontab -e command should be used instead as it performs syntax checks.

Why Incorrect

A. The file /etc/crontab.db is not a standard file used by the cron daemon; cron uses plain text files.
C. The /etc/cron.d directory is for system-wide jobs, not user-specific ones, and cron.user.d is not a standard directory.
D. The crontab command does not store its files in user home directories by default.
E. User crontabs are stored as individual files per user, not in a single shared file.

References

1. crontab(5) manual page. In the "FILES" section, it specifies /var/spool/cron as the directory for crontabs. It states, "Each user can have their own crontab, and though these are files in /var/spool/cron, they are not intended to be edited directly."

2. Red Hat Enterprise Linux 8 Documentation, Chapter 27. Automating system tasks, Section 27.1. Introduction to cron. It states: "User-defined crontab files are located in the /var/spool/cron/ directory."

3. The Debian Administrator's Handbook, 11th Edition (Buster), Section 9.7.1. cron. It notes that user crontab files "are stored in /var/spool/cron/crontabs/ and have the same name as the user who owns them."

Scroll to Top