1Z0-106 practice question 4 of 15

Which two statements are true about the configuration and use of cron or anacron?

Full set: 60 questions
Answer options
A: cron jobs may run only once a minute.
B: All crontabs are held in the /etc/cron.d directory.
C: The crond daemon looks for jobs only in /etc/crontab.
D: anacron jobs may run only once a day. Correct answer
E: anacron jobs are used to run cron jobs if the system was powered off when they were scheduled to run. Correct answer
Correct Answer:
D. anacron jobs may run only once a day.; E. anacron jobs are used to run cron jobs if the system was powered off when they were scheduled to run.
Explanation

The anacron utility is designed for systems that are not running continuously, such as laptops or desktops. Its configuration file, /etc/anacrontab, specifies job frequency in days, meaning the highest frequency a job can run is once per day. The primary purpose of anacron is to ensure that periodic system jobs (e.g., daily, weekly, monthly scripts typically managed by cron) are executed even if the system was powered off at their scheduled time. It checks timestamps to see if a job was missed and runs it if necessary after the system boots.

Why Incorrect

A. cron's minimum scheduling granularity is one minute, but jobs can be scheduled for any longer interval (e.g., hourly, daily), not only once a minute.
B. This is incorrect. User-specific crontabs are located in /var/spool/cron, and the main system-wide crontab is /etc/crontab.
C. The crond daemon reads jobs from /etc/crontab, the /etc/cron.d/ directory, and the user-specific spool directory (/var/spool/cron).

References

1. Oracle Linux 8 Documentation, Managing Core System Configuration, Chapter 10. Automating System Tasks. The documentation states, "The anacron utility is similar to crond but is intended for systems that are not running continuously." It also describes the /etc/anacrontab format as period-in-days delay-in-minutes job-identifier command, confirming the minimum period is one day.

2. anacron(8) Linux manual page. "Anacron can be used to execute commands periodically, with a frequency specified in days... For each job, Anacron checks whether this job has been executed in the last n days, where n is the period specified for that job. If not, Anacron runs the job's shell command..." This confirms options D and E.

3. crontab(5) Linux manual page. This page details the file format for cron jobs, showing the time fields are "minute, hour, day of month, month, day of week," which establishes the one-minute minimum granularity but does not restrict jobs to only that frequency, making option A incorrect. It also specifies the locations for crontab files, refuting options B and C.

Scroll to Top