3

Using Ubuntu 18.04.3 I am unable to get information about the NTP offset using timedatectl timesync-status as I get a Unknown operation timesync-status prompt. Checking the service state with timedatectl and systemctl status systemd-timesyncd.service works just fine. Is there another way to check the offset?

ThomasW
  • 31

1 Answers1

1

Although it may not be exactly what you have asked for, you can use the following method (no sudo is required):

$ /bin/journalctl --unit=systemd-timesyncd -n 1  | tail -1
Aug 16 15:57:13 xxxxxx systemd-timesyncd[958]: Synchronized to time server 169.254.169.254:123 (169.254.169.254).

With the command above, you determine the time server timesyncd is synchronized to. In this example, it is 169.254.169.254.

Then you can use the command ntpdate -q with this server like this:

$ ntpdate -q 169.254.169.254
server 169.254.169.254, stratum 2, offset -0.000081, delay 0.02580
 1 Sep 12:20:24 ntpdate[3978]: adjust time server 169.254.169.254 offset -0.000081 sec

Note: You can install the ntpdate command, using apt install ntpdate.

FedKad
  • 13,420