用ntpdate從時間服務器更新時間
1.如果你的linux系統根本沒有ntpdate這個命令
yum install -y ntp
2.安裝完了之后,你不要做什么配置,也不需要,直接測試一下
[root@git conf.d]# ntpdate asia.pool.ntp.org 21 Mar 10:52:01 ntpdate[9247]: step time server 209.58.185.100 offset 38761.507576 sec
3.如果出去上面的內容說明,同步成功了。然后在crontab里面加上以下內容。
*/10 * * * * ntpdate asia.pool.ntp.org
4.推薦幾個時間服務器
time.nist.gov time.nuri.net asia.pool.ntp.org asia.pool.ntp.org asia.pool.ntp.org asia.pool.ntp.org