nerdexam
Linux_Foundation

LFCS · Question #278

Which of the following crontab entries could be used to set the system time at regular intervals?

The correct answer is E. 1 0 * * * /usr/sbin/ntpdate ntp1.digex.net > /dev/null 2>&1. A crontab entry using ntpdate is the appropriate method to set the system time from an NTP server at regular intervals.

Submitted by parkjh· Apr 18, 2026Operation of Running Systems

Question

Which of the following crontab entries could be used to set the system time at regular intervals?

Options

  • A1 0 * * * date $d $t $24
  • B1 0 * * * settime $d $t $24
  • C1 0 * * * date<ntp1.digex.net
  • D1 0 * * * /usr/sbin/runcron date <ntp1.digex.net
  • E1 0 * * * /usr/sbin/ntpdate ntp1.digex.net > /dev/null 2>&1

How the community answered

(50 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    4% (2)
  • D
    8% (4)
  • E
    84% (42)

Why each option

A crontab entry using `ntpdate` is the appropriate method to set the system time from an NTP server at regular intervals.

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

The `date` command alone is for displaying or manually setting the time and does not inherently synchronize with an external time source like an NTP server.

B1 0 * * * settime $d $t $24

`settime` is not a standard command-line utility used for synchronizing system time from an NTP server.

C1 0 * * * date<ntp1.digex.net

The syntax `date<ntp1.digex.net` is incorrect for synchronizing time; the `date` command does not accept an NTP server hostname via standard input.

D1 0 * * * /usr/sbin/runcron date <ntp1.digex.net

`/usr/sbin/runcron` is not a standard utility for time synchronization, and the command `date <ntp1.digex.net` is still syntactically incorrect for synchronizing with an NTP server.

E1 0 * * * /usr/sbin/ntpdate ntp1.digex.net > /dev/null 2>&1Correct

The `ntpdate` command synchronizes the system's clock with a specified NTP server, making it suitable for a cron job that needs to regularly update the system time. The redirection `> /dev/null 2>&1` suppresses all command output, which is standard practice for cron entries.

Concept tested: Cron job for time synchronization

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

Topics

#crontab#time synchronization#NTP#ntpdate

Community Discussion

No community discussion yet for this question.

Full LFCS Practice