htpdate代替ntpdate同步時間

在用ntpdate同步時間時,提示以下錯誤,個人服務器在機房託管,極可能機房將NTP流量屏蔽。
[root@localhost htpdate]# ntpdate ntp.neu6.edu.cn
3 Apr 20:13:31 ntpdate[19954]: no server suitable for synchronization foundgit

解決辦法,使用htpdate進行定時同步
安裝:
git clone https://github.com/iridium77/htpdategithub

make&&make install服務器

htpdate -t -s ntp.neu.edu.cn
-t:關閉時間檢查,默認狀況下,時間偏移量大於一年,本地時間沒法修改,使用-t設置,任什麼時候間戳都將被接受。
-s:當即設置時間。ide

缺點:時間偏差可能在0.5s以內ui

相關文章
相關標籤/搜索