nerdexam
CompTIA

LX0-104 · Question #491

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. The ntpdate command, when scheduled in a crontab entry, can synchronize the system time with a specified NTP server at regular intervals.

Essential System Services

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

(63 responses)
  • B
    94% (59)
  • C
    3% (2)
  • D
    2% (1)
  • E
    2% (1)

Why each option

The ntpdate command, when scheduled in a crontab entry, can synchronize the system time with a specified NTP server at regular intervals.

A1 0 * * * date $d $t $24

The date command with $d $t $24 syntax is incorrect for synchronizing time with an NTP server; it's used for displaying or setting local time with specific arguments.

B1 0 * * * ntpdate ntp1.digex.netCorrect

The ntpdate command is specifically designed for performing a one-time synchronization of the system clock with a specified Network Time Protocol (NTP) server. Using ntpdate ntp1.digex.net in a crontab entry will fetch the accurate time from ntp1.digex.net and adjust the local system clock accordingly at 00:01 daily.

C1 0 * * * date ntp1.digex.net

The date command cannot directly synchronize with an NTP server using a server hostname; it's for local time management.

D1 0 * * * runcron date ntp1.digex.net

runcron is not a standard command for scheduling tasks within cron, and the command structure is incorrect for time synchronization.

E1 0 * * * settime $d $t $24

settime is not a standard command for time synchronization, and the arguments are incorrect for NTP.

Concept tested: Cron job for NTP time synchronization

Source: https://man7.org/linux/man-pages/man8/ntpdate.8.html

Topics

#cron jobs#ntpdate#time synchronization#system time

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice