-2

I use 14.04.1-Ubuntu. When execute date in command line, I get time which about 1 min different comparing Greenwich Mean Time or other source. I synchronized it using sudo ntpdate -s time.nist.gov few months ago but it jumped away again. Why does it happen? How to keep accurate time on Ubuntu continuously?

closed as off-topic by MadHatter, Ward, Jenny D, mdpc, Reaces Jun 3 '17 at 19:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – MadHatter, Ward, Jenny D, mdpc, Reaces
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Why is it downvoted? – Justas May 25 '17 at 8:27
4
  1. Install ntp package sudo apt-get install ntp
  2. Edit /etc/ntp.conf for your neighbor ntp server sudo vi +/^server /etc/ntp.conf
  3. Reload ntp configuration sudo service ntp reload
  4. Check time sync status with ntpq -p. It takes some while for synchronized (*) status. sudo ntpq -p

Ref: Ubuntu 14.04 >> Ubuntu Server Guide >> Networking

https://help.ubuntu.com/14.04/serverguide/NTP.html

6

How to keep accurate time on Ubuntu continuously?

By enabling the ntpd service and running it continuously.

I synchronized it using sudo ntpdate -s time.nist.gov few months ago but it jumped away again. Why does it happen?

The hardware clock in computer systems is simply not accurate enough.

6

Unfortunately Ubuntu hasn't added the disclaimer from NTP.org's ntp-4.2.*\html\ntpdate.html manual to Ubuntu's ntpdate(8) manpage, like for example FreeBSD has:

ntpdate - set the date and time via NTP

Disclaimer: This program has known bugs and deficiencies and nobody has volunteered to fix them in a long time. The good news is the functionality originally intended for this program is available in the ntpd and sntp programs.

See the Deprecating ntpdate topic in the NTP Support wiki for a thorough discussion and analysis of the issues. See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page and/or the sntp - Simple Network Time Protocol (SNTP) Client page. After a suitable period of mourning, the ntpdate program will be retired from this distribution.

If Ubuntu did so, you wouldn't even have to Google for this, not to mention asking it from Serverfault.

  • 1
    To be fair, if you use ntpd -q only once in months, you won't yield better results. – Sven May 17 '17 at 8:13
  • 1
    True, but the point of this answer is that if this disclaimer was in the manpage, it would have directed OP to the right direction: ntpdate is deprecated, let's see what there is on man ntpd. Now it's not even in the "See also" section. I truly hope that reading man ntpd would enlighten the topic enough for not using merely -q. – Esa Jokinen May 17 '17 at 8:20
  • +1 for including the deprecation notice. – gf_ Aug 18 '17 at 0:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.