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?
Asked
Active
Viewed 2,958 times
3
ThomasW
- 31
- 1
- 2
-
Not really helpful remark: on my 19.04 system `timedatectl timesync-status` does work although the autocompletion doesn't show the command. – guntbert Sep 01 '19 at 19:44
-
FYI, the `timedatectl` command has evolved very quickly since 18.04 and the new features are not available in the old OS. (new features are not added retroactively). – Alexis Wilke May 01 '21 at 17:50
1 Answers
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
- 9,212
- 7
- 40
- 79