16
Jan
08

Howto set the correct server time

In the last years, I often had the problem that the system time of a linux server was not correct.
There’s a simple way the sync your internal clock with some of these ultra-correct clocks over the internet.
Just use ntpdate.

#ntpdate SERVERADDRESS

Here is a list with public timservers.




    2 Responses to “Howto set the correct server time”


    1. 1 Jonas Feb 14th, 2008 at 3:42 pm

      djb has a nice tool called “clockspeed” that will slow your clock down or speed it up if needed. Just edit conf-cc and add “–include error.h” so it compiles with modern glibc packages and do a “make; make setup check”. Then perform the following steps:

      1. start the daemon: “# nohup /usr/local/clockspeed/bin/clockspeed &”
      2. give it the current time: “# /usr/local/clockspeed/bin/sntpclock ntp.srv.ip.123 | /usr/local/clockspeed/bin/clockadd”
      3. now, after a few hours give it an updated reading so it can adjust to your clock:
      “# at now + 8 hours
      at> /usr/local/clockspeed/bin/sntpclock ntp.srv.ip.123 > /usr/local/clockspeed/adjust
      at> ^D”

      4. repeat step 3 for “+ 16 hours” and “+ 24 hours” to get a more accurate reading

      5. put a small script into /etc/init.d that starts clockspeed at boottime, something like:
      #!/bin/sh
      /usr/local/clockspeed/bin/clockspeed &

      6. … [need to figure this out]

      7. profit!

    2. 2 Linux Ntp Server Jul 31st, 2008 at 3:34 pm

      anybody here know of a good site to find more info on linux ntp server? I\’ve got this site bookmarked and im gonna keep checking it out, but i still would like to find a site that covers linux ntp server a little more thoroughly..thanks

    Leave a Reply