How to schedule automatic patch syncing with cron?
Short answer
E 0 0-23/2 * 5 0-2 /root/update-from-remote-to-local.sh
Question
Key Takeaways
The exam tests understanding of cron field syntax, particularly the equivalence of step values (0-23/2) and explicit lists (0,2,4...14), and the common trap of confusing Sunday–Wednesday (0–3) with Sunday–Tuesday (0–2).
This question tests the ability to construct cron expressions for scheduled tasks, specifically combining time ranges, intervals, and day-of-week fields. Community consensus confirms that options using '0-23/2' or explicit even-hour lists with Sunday–Tuesday (0–2) in May are correct.
Common mistake: Many candidates incorrectly choose options with '0-3' for the day-of-week field, not realizing that 0–3 means Sunday through Wednesday, not Sunday through Tuesday as required.
Expert Analysis
Why the Answer Is Correct
Option E uses '0 0-23/2 * 5 0-2', which means the script runs at minute 0, every 2 hours from 0 to 23, only in May (month 5), on days Sunday (0) through Tuesday (2). This perfectly matches the requirement: every two hours on Sundays through Tuesdays in May. The step notation '0-23/2' is functionally identical to listing all even hours explicitly.
Why the Other Options Are Wrong
Options A, B, and D use '0-3' for the day-of-week field, which includes Wednesday (day 3), violating the requirement to run only Sunday through Tuesday. Option C uses the correct day range (0-2) but only lists hours up to 14 (2 PM), missing the evening and night runs. Option F (if present) would likely be another valid even-hour list with the correct day range.
Community Comment Notes
Commenters consistently note that options with '0-3' must be eliminated because they extend the schedule into Wednesday. Multiple users confirm that only options with '0-2' for days and full 24-hour even-hour coverage are valid. The community agrees that understanding cron step notation and day-of-week numbering is critical for this question type.
Official Reference
https://man7.org/linux/man-pages/man5/crontab.5.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
When analyzing cron expressions, always verify each field independently: minute, hour, day-of-month, month, and day-of-week. Remember that day-of-week 0–2 means Sunday through Tuesday, and step values like '0-23/2' cover the full range, not just a partial one.
Community Votes
100% of anonymous learners picked answer E. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 4 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 4
-
ID77 👍 1 Answered EC should be eliminated because it only runs until 2 PM instead of covering the full 24-hour range. E&F yes.
-
sterguy 👍 1 Answered EI agree EF are the only options that make sense
-
Mistermiyagi 👍 1 Answered EI also agree E and F are the correct answers
-
74cd09c 👍 2EF are correct
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.