nerdexam
Linux_Foundation

LFCS · Question #768

Which crontab entry 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. The ntpdate command is used to synchronize the system clock with a remote NTP server, and it's commonly run from cron for periodic time synchronization.

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

Question

Which crontab entry 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

(36 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    3% (1)
  • D
    11% (4)
  • E
    78% (28)

Why each option

The `ntpdate` command is used to synchronize the system clock with a remote NTP server, and it's commonly run from cron for periodic time synchronization.

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

The `date` command with the given arguments is used for displaying or setting the date manually, not for synchronizing with an NTP server; `$d`, `$t`, `$24` are not valid arguments for NTP synchronization.

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

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

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

Using `date` with input redirection `<ntp1.digex.net` is syntactically incorrect and not how time synchronization is performed.

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

`runcron` is not a standard utility for running cron jobs, and the subsequent `date <ntp1.digex.net` is still an incorrect method for NTP synchronization.

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

This crontab entry runs `/usr/sbin/ntpdate` at 00:01 daily, synchronizing the system clock with `ntp1.digex.net`. `ntpdate` is a standard command for one-time manual synchronization, and redirecting output to `/dev/null` suppresses command output, which is good practice for cron jobs.

Concept tested: Scheduling NTP time synchronization

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

Topics

#Cron#NTP#Time Synchronization#System Maintenance

Community Discussion

No community discussion yet for this question.

Full LFCS Practice