102-500 · Question #134
Which crontab entry could be used to set the system time at regular intervals?
The correct answer is B. 1 0 * * * ntpdate ntp1.digex.net. ntpdate is the correct tool for synchronizing system time with a network time server - option B runs it at 1 minute past midnight every day against a real NTP host (ntp1.digex.net), which is exactly what time synchronization requires. Why the distractors fail: A & E invent…
Question
Options
- A1 0 * * * date $d $t $24
- B1 0 * * * ntpdate ntp1.digex.net
- C1 0 * * * date ntp1.digex.net
- D1 0 * * * runcron date ntp1.digex.net
- E1 0 * * * settime $d $t $24
How the community answered
(23 responses)- A4% (1)
- B83% (19)
- D9% (2)
- E4% (1)
Explanation
ntpdate is the correct tool for synchronizing system time with a network time server - option B runs it at 1 minute past midnight every day against a real NTP host (ntp1.digex.net), which is exactly what time synchronization requires.
Why the distractors fail:
- A & E invent nonexistent command syntax (
date $d $t $24,settime $d $t $24) - neitherdatenorsettimeworks this way to sync from a network source. - C misuses
date, which is a local clock utility; passing it a hostname is not valid syntax and it cannot contact NTP servers. - D adds
runcron, a fictitious wrapper that doesn't exist in any standard Linux distribution.
Memory tip: Think "NTP = Network Time Protocol" - you need a command with "ntp" in it (ntpdate) and a real NTP hostname to sync over a network. Any option using date alone or made-up commands can be eliminated immediately.
Topics
Community Discussion
No community discussion yet for this question.