XK0-004 · Question #416
An administrator wants to run a script on the second Monday of every month. The script should be executed at 7:00 a.m. and 1:00 p.m. Which of the following entries to the crontab will accomplish this?
The correct answer is A. Option A. Scheduling a job on the second Monday of every month requires constraining the day-of-month field to 8-14 while setting day-of-week to Monday.
Question
An administrator wants to run a script on the second Monday of every month. The script should be executed at 7:00 a.m. and 1:00 p.m. Which of the following entries to the crontab will accomplish this?
Exhibit
Options
- AOption A
- BOption B
- COption C
- DOption D
How the community answered
(25 responses)- A84% (21)
- B8% (2)
- C4% (1)
- D4% (1)
Why each option
Scheduling a job on the second Monday of every month requires constraining the day-of-month field to 8-14 while setting day-of-week to Monday.
A cron entry such as '0 7,13 8-14 * 1' correctly targets the second Monday because days 8 through 14 of any month always contain exactly one Monday. Setting day-of-week to 1 (Monday) combined with that day-of-month range guarantees the second occurrence. The comma-separated hours 7 and 13 handle the 7:00 a.m. and 1:00 p.m. execution times in a single entry.
Option B uses a day-of-month range or day-of-week value that does not reliably isolate the second Monday across all months.
Option C does not correctly combine the 8-14 day-of-month window with the Monday day-of-week constraint needed to target only the second Monday.
Option D fails to specify both execution times with a comma-separated hour field or uses an incorrect day range for isolating the second Monday.
Concept tested: Crontab scheduling for nth weekday of the month
Source: https://www.man7.org/linux/man-pages/man5/crontab.5.html
Topics
Community Discussion
No community discussion yet for this question.
