Which two statements are true about the configuration and use of cron or anacron?
Correct Answer: D,E
Option D: anacron jobs may run only once a day.
* Explanation:
* Anacronis designed for systems that are not running continuously (e.g., desktops or laptops that may be powered off at night). It ensures that scheduled tasks are executed at the specified intervals.
* Anacron jobs are defined with periods indays. The minimal unit of time for scheduling in Anacron isone day. Therefore, Anacron can schedule jobs to runonce a dayat most.
* It is not intended for tasks that need to run multiple times per day.
* Oracle Linux Reference:
* OracleLinux 8: Scheduling Tasks- Section onAnacron Configuration Files:
"Anacron is used to run commands periodically with a frequency specified in days." Option E: anacron jobs are used to run cron jobs if the system was powered off when they were scheduled to run.
* Explanation:
* Anacron complements Cron by ensuring thatscheduled jobs are not missedif the system is powered off or in standby mode at the time they were supposed to run.
* When the system boots up, Anacron checks for any scheduled jobs that did not run and executes them accordingly.
* This is particularly useful for laptops or desktops that are not always on.
* Oracle Linux Reference:
* OracleLinux 8: Scheduling Tasks- Section onUnderstanding Anacron:
"Anacron is designed to run commands periodically with specified frequency, but unlike cron, it does not assume that the system is running continuously." Why Other Options Are Not Correct:
* Option A:cron jobs may run only once a minute.
* Explanation:
* Cron allows scheduling tasks with a minimum granularity ofone minute. However, this means that tasks can be scheduled to runevery minute, not limited to only once a minute.
* Multiple cron jobs can be scheduled to run at the same minute.
* Therefore, the statement is misleading; cron jobs can runas frequently as every minute, but notonly once a minute.
* Option B:All crontabs are held in the /etc/cron.d directory.
* Explanation:
* The /etc/cron.d directory is used for system-wide cron jobs provided by packages or administrators.
* User-specific cron jobs are stored in /var/spool/cron/ or managed via the crontab command and not placed in /etc/cron.d.
* Additionally, the system crontab file is /etc/crontab, and there are also directories like /etc
/cron.hourly, /etc/cron.daily, etc.
* Option C:The crond daemon looks for jobs only in /etc/crontab.
* Explanation:
* The crond daemon checks multiple locations for scheduled jobs:
* User crontabs managed via the crontab -e command (stored in /var/spool/cron/).
* System-wide crontab file (/etc/crontab).
* The /etc/cron.d/ directory.
* The /etc/cron.hourly/, /etc/cron.daily/, /etc/cron.weekly/, and /etc/cron.monthly/ directories.
* Therefore, crond does not look for jobsonlyin /etc/crontab.
Conclusion:
OptionsDandEare correct because they accurately describe the characteristics and purposes of Anacron in the context of scheduling tasks on an Oracle Linux system.