nerdexam
LPI

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…

Administrative Tasks

Question

Which crontab entry could be used to set the system time at regular intervals?

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)
  • A
    4% (1)
  • B
    83% (19)
  • D
    9% (2)
  • E
    4% (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) - neither date nor settime works 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

#crontab#NTP#ntpdate#system time

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice