Portál AbcLinuxu, 26. července 2025 22:12
Time adjustments are made by ntpdate in one of two ways. If ntpdate determines the clock is in error more than 0.5 second it will simply step the time by calling the system settimeofday() routine. If the error is less than 0.5 seconds, it will slew the time by calling the system adjtime() routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when ntpdate is run by cron every hour or two.
yum install ntp && chkconfig ntpd on
/etc/ntp.conf: restrict 127.0.0.1 restrict -6 ::1 server 0.fedora.pool.ntp.org iburst server 1.fedora.pool.ntp.org iburst server 2.fedora.pool.ntp.org iburst server 3.fedora.pool.ntp.org iburst
synchronised to NTP server (77.78.110.71) at stratum 3 time correct to within 77 ms polling server every 1024 sa kdybych už byl úplně chtivý informací, zkusil bych ntpq a příkaz peers.
restrict
? Hádám, že je to pro případ že bych v pominutí smyslu vypnul iptables, tak aby mě někdo nepoužíval jako časový server.
fedora.pool.ntp.org
asi nebudou ty nejlepší servery a synchronizace proti serveru v americe s delay 100ms a jitter 50ms je blbost.
Na druhou stranu, pokud jde tazateli o přibližnou synchronizaci a seštelování jednou či dvakrát denně tak cron a ntpdate je v pohodě.
Co takhle vyřešit HW problém?
Pokud se čas rozchází moc a čímdál tím víc tak nebude slabá baterka na MB (nejdříve to začne odnášet čas pokud je zrada tam).
No a potom to řešit SW použít ntpd a je po problému a jako servery vložit:
server 0.cz.pool.ntp.org
server 1.cz.pool.ntp.org
server 2.cz.pool.ntp.org
server 3.cz.pool.ntp.org
crontab -e
30 01 * * * /usr/sbin/ntpdate sk.pool.ntp.org
dufam ze to bude fungovat a v noci o 1:30 to updatuje
(btw zistil som, ze za 24 hod to robi rozdiel cca 10 s)
Oct 31 01:30:01 local-server /USR/SBIN/CRON[32736]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null)
Lenze ten riadok vidim kazdych 10 min :)
-0.477450 1351253295 0.000000
1351253295
UTC
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.