Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Placing ntpdate into cron seems to be no longer a good idea.

What is an

  • easy
  • state-of-the-art
  • automatic
  • environmental friendly ;-)
  • sleek

way of keeping a (debian) server's time clock up to date?

share|improve this question

closed as not a real question by John Gardeniers, Zoredache, mdpc, Chris S Feb 14 '12 at 21:26

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What version (of debian)? –  Mathias R. Jessen Feb 14 '12 at 20:32
6  
The very article you linked to answers your question. What else do you need to know? –  John Gardeniers Feb 14 '12 at 20:32

2 Answers 2

up vote 10 down vote accepted

apt-get install ntp. If you've never had it installed before, you should be good to go. If you have, and therefore, might have stale config files, you could apt-get remove --purge ntp and apt-get install ntp again to get new config files. Or if you want to keep your config files, I recommend checking that /etc/default/ntp has NTPD_OPTS='-g'. This says to ntpd "try to correct the time, even if it is way off", and make sure at least one good server in /etc/ntp.conf has the iburst option, like:

server 0.debian.pool.ntp.org iburst

This allows a burst of packets to be sent which will get your time synced quicker.

If you ever need to have something wait for time sync before proceeding, run ntp-wait. If, for example, you have a service which shouldn't start until you are sure you have your time corrected. (which you previously might have used ntpdate for)

share|improve this answer
    
Installing ntp is enough? No further configuration work required? That's it? No ntpdate? –  powtac Feb 14 '12 at 21:57
2  
that's it. then you can run ntpq -p at any time to see how well it thinks it is doing. –  stew Feb 14 '12 at 22:00
    
What I did now: apt-get remove --purge ntpdate apt-get remove --purge ntp apt-get install ntp. –  powtac Feb 15 '12 at 0:23

Couldn't you just set ntpd to start at boot as suggested on the mailing list? That's what I've been doing for as long as I can remember.

share|improve this answer

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