Portál AbcLinuxu, 14. května 2025 01:25
nastavím synchronizaci času pomocí NTP v Debianu s nějakým časovým serveremAk to znamená, že sa spustí NTP démon, tak synchronizácia by sa mala odohrať každých 64-1024 sekúnd. Vychádzam z
minpoll
a maxpoll
nastavení v /etc/ntp.conf
. Pokiaľ máš aspoň 33.6 kbs, tak to množstvo dát nerieš.
[root][~][19:27:36] crontab -l | grep ntp */10 * * * * /usr/sbin/ntpdate -s ntp.karpo.cz
Jan 3 11:20:29 paranoid acpid: client connected from 13855[0:0] Jan 3 13:17:01 paranoid ntpdate[23382]: adjust time server yakumo.nat offset -55.388892 sec Jan 3 13:16:25 paranoid hald: unmounted /dev/sda1 from '/media/disk' on behalf of uid 1000
ntpdate(8)
pod FreeBSD 6.4:
-B Force the time to always be slewed using the adjtime(2) system call, even if the measured offset is greater than +-128 ms. The default is to step the time using settimeofday(2) if the offset is greater than +-128 ms. Note that, if the offset is much greater than +-128 ms in this case, it can take a long time (hours) to slew the clock to the correct value. During this time, the host should not be used to synchronize clients. -b Force the time to be stepped using the settimeofday(2) system call, rather than slewed (default) using the adjtime(2) system call. This option should be used when called from a startup file at boot time.Takze, ak sa ten ntpdate cronom spusta dost casto na to, aby odchylka nebola vacsia ako 128ms, ziadne casopriestorove skoky sa nekonaju. U mna je pri desatminutovom intervale synchronizacie odchylka 12 az 15 milisekund.
-b Force the time to be stepped using the settimeofday(2) system call, rather than slewed (default) using the adjtime(2) system call. This option should be used when called from a startup file at boot time.Staci ho spustit hned pri boote, necakat na prve spustenie cronom. Bootovacie skripty FreeBSD tuto funkcionalitu obsahuju by default, staci aby to admin povolil a nastavil NTP server:
[root][~][20:52:02] grep ntpdate /etc/defaults/rc.conf ntpdate_enable="NO" # Run ntpdate to sync time on boot (or NO). ntpdate_program="/usr/sbin/ntpdate" # path to ntpdate, if you want a different one. ntpdate_flags="-b" # Flags to ntpdate (if enabled). ntpdate_config="/etc/ntp.conf" # ntpdate(8) configuration file ntpdate_hosts="" # Whitespace-separated list of ntpdate(8) servers.Co sa tyka Linuxu, nemozem sluzit. Ale typujem, ze tam to bude zavisle od distribucie (ako v Linuxe takmer vsetko), a osobne si myslim, ze to tam skor nebude ako bude, nakolko vela distribucii NTP-related programy by default neinstaluje.
Mohu ještě poprosit o radu, jak lze vypnout zobrazování provádění Cronu v syslogu?
Hledal jsem to v /etc/syslog.conf ... ale tam nevím jak co změnit ... poradíme mi prosím?
Děkuji.
co říká ntpstat
?
u mě to vypadá takto:
[richard@mao ~]$ ntpstat
synchronised to NTP server (81.0.239.181) at stratum 3
time correct to within 57 ms
polling server every 256 s
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.