Difference between revisions of "Ntp"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
(hint to internet time server pool.ntp.org)
Line 2: Line 2:
  
 
= Synchronize time =
 
= Synchronize time =
To sync the time with the time server ''ntp.company.com'' use the [[command]]
+
To sync the time with the time server ''pool.ntp.org'' use the [[command]]
  sntp -P no -r ''ntp.company.com''
+
  sntp -s no pool.ntp.org
  
 
= Show time offset from time server =
 
= Show time offset from time server =

Revision as of 05:03, 6 May 2014

NTP is the network time protocol. It allows you to fetch the current date/time from an internet time server. You can also use it to provide a network time service.

Synchronize time

To sync the time with the time server pool.ntp.org use the command

sntp -s no pool.ntp.org

Show time offset from time server

# sntp timeserver.mycompany.com
2014-02-18 10:09:11.391178 (-0100) +6.45592 +/- 0.000427 secs

Means that timeserver.mycompany.com is 6.5 seconds in the future compared to the local clock.

Query status

# /etc/init.d/ntp status
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*timehost1.local .PPS.            1 u  356 1024  377    1.404    0.049   0.154

Checking for network time protocol daemon (NTPD):                    running

Configure it

Edit /etc/ntp.conf, add your time server like this:

server myserver.domain