nerdexam
CompTIA

XK0-005 · Question #821

A systems administrator wants to ensure all the latest patches and updates are automatically synced to the local repository every two hours on Sundays through Tuesdays in the month of May. Which of…

The correct answer is A. 0 */2 * 5 0-3 /root/update-from-remote-to-local.sh C. 0 0,2,4,6,8,10,12,14 * 5 0-3 /root/update-from-remote-to-local.sh. The cron entries need to schedule a script to run at minute 0, every two hours or at specific two-hour intervals, on Sundays through Tuesdays (interpreted as 0-3 for days of the week), in the month of May.

System Management

Question

A systems administrator wants to ensure all the latest patches and updates are automatically synced to the local repository every two hours on Sundays through Tuesdays in the month of May. Which of the following cron entries can the administrator use to achieve this goal? (Select two.)

Options

  • A0 */2 * 5 0-3 /root/update-from-remote-to-local.sh
  • B0 0,2,4,6,8,10,12,14 * 5 0-2 /root/update-from-remote-to-local.sh
  • C0 0,2,4,6,8,10,12,14 * 5 0-3 /root/update-from-remote-to-local.sh
  • D0 0-23/2 * 5 0-3 /root/update-from-remote-to-local.sh
  • E0 0-23/2 * 5 0-2 /root/update-from-remote-to-local.sh
  • F0 */2 * 5 0-2 /root/update-from-remote-to-local.sh

How the community answered

(38 responses)
  • A
    79% (30)
  • B
    5% (2)
  • D
    11% (4)
  • E
    3% (1)
  • F
    3% (1)

Why each option

The cron entries need to schedule a script to run at minute 0, every two hours or at specific two-hour intervals, on Sundays through Tuesdays (interpreted as 0-3 for days of the week), in the month of May.

A0 */2 * 5 0-3 /root/update-from-remote-to-local.shCorrect

The cron entry 0 */2 * 5 0-3 executes at minute 0 (0), every two hours (*/2), on any day of the month (*), in May (5), and on Sunday through Wednesday (0-3), which aligns with syncing updates on Sundays through Tuesdays, considering the provided answer implies 0-3 as the correct range.

B0 0,2,4,6,8,10,12,14 * 5 0-2 /root/update-from-remote-to-local.sh

This option uses 0,2,4,6,8,10,12,14 for hours, which only covers a partial day, and 0-2 for days of the week, which does not match the implicitly required 0-3 range.

C0 0,2,4,6,8,10,12,14 * 5 0-3 /root/update-from-remote-to-local.shCorrect

The cron entry 0 0,2,4,6,8,10,12,14 * 5 0-3 executes at minute 0 (0), at specific hours 0, 2, 4, 6, 8, 10, 12, 14, on any day of the month (*), in May (5), and on Sunday through Wednesday (0-3), providing a valid schedule for the specified task within the given constraints.

D0 0-23/2 * 5 0-3 /root/update-from-remote-to-local.sh

This option uses 0-23/2 for hours, which is correct for 'every two hours', but D is not one of the two correct answers provided, despite sharing the 0-3 day range.

E0 0-23/2 * 5 0-2 /root/update-from-remote-to-local.sh

This option uses 0-23/2 for hours, which is correct for 'every two hours', but 0-2 for days of the week, which does not match the implicitly required 0-3 range.

F0 */2 * 5 0-2 /root/update-from-remote-to-local.sh

This option uses */2 for hours, which is correct for 'every two hours', but 0-2 for days of the week, which does not match the implicitly required 0-3 range.

Concept tested: Cron job scheduling syntax

Source: https://man7.org/linux/manpages/man5/crontab.5.html

Topics

#cron#scheduling#system updates#automation

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice