XK0-005 · Question #503
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new…
The correct answer is C. The OnCalendar schedule is incorrect in the timer definition. If the systemd timer runs daily instead of every two hours, the issue is in the timer unit's schedule definition. The OnCalendar= directive (or OnUnitActiveSec=) controls the recurrence interval. An incorrect value such as OnCalendar=daily instead of OnCalendar=*:0/2 (every 2…
Question
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
Options
- AThe checkdiskspace.service is not running.
- BThe checkdiskspace.service needs to be enabled.
- CThe OnCalendar schedule is incorrect in the timer definition.
- DThe system-daemon services need to be reloaded.
How the community answered
(24 responses)- A21% (5)
- B8% (2)
- C58% (14)
- D13% (3)
Explanation
If the systemd timer runs daily instead of every two hours, the issue is in the timer unit's schedule definition. The OnCalendar= directive (or OnUnitActiveSec=) controls the recurrence interval. An incorrect value such as OnCalendar=daily instead of OnCalendar=*:0/2 (every 2 hours) or OnUnitActiveSec=2h would cause the observed behavior. Option A is irrelevant - the service not running would cause no execution, not a wrong interval. Option B (enabling the service) affects startup, not scheduling. Option D (reloading daemon) is already implied by the server restart performed.
Topics
Community Discussion
No community discussion yet for this question.