LX0-104 · Question #71
Where are user specific crontabs stored?
The correct answer is B. As individual per-user files within /var/spool/cron.. User-specific crontab entries, which define scheduled tasks for individual users, are typically stored as separate files within the /var/spool/cron directory. Each file is named after the respective user, allowing the cron daemon to manage their scheduled jobs independently.
Question
Options
- AIn the database file /etc/crontab.db which is shared by all users.
- BAs individual per-user files within /var/spool/cron.
- CAs individual per-user files in /etc/cron.user.d.
- DIn the .crontab file in the user's home directory.
- EIn the file /var/cron/user-crontab which is shared by all users.
How the community answered
(33 responses)- A6% (2)
- B88% (29)
- C3% (1)
- E3% (1)
Why each option
User-specific crontab entries, which define scheduled tasks for individual users, are typically stored as separate files within the /var/spool/cron directory. Each file is named after the respective user, allowing the cron daemon to manage their scheduled jobs independently.
Crontabs are not typically stored in a single shared database file like /etc/crontab.db; /etc/crontab is a system-wide crontab, but user crontabs are separate.
On most Unix-like systems, user-specific crontab files are stored in /var/spool/cron (or /var/spool/cron/crontabs on some systems like Debian/Ubuntu), with each file named after the user it belongs to. The cron daemon reads these files to execute scheduled jobs for each user.
/etc/cron.user.d is not a standard location for user crontabs; /etc/cron.d is for system-wide crontabs managed by packages.
While a user might create a .crontab file in their home directory, this file is not directly read by the cron daemon; it must be installed using crontab <filename>.
/var/cron/user-crontab is not a standard location or format for user-specific crontabs.
Concept tested: Crontab file location
Source: https://linux.die.net/man/5/crontab
Topics
Community Discussion
No community discussion yet for this question.