Centos 7.2 time synchronization

 

安装 ntpdate  ,  yum -y install ntpdate 

 

#ntpdate cn.pool.ntp.org

 

Delete local time and set time zone to Shanghai

 

 

rm -rf /etc/localtime

 

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

 

 

 

Automatically sync time

 

#Add the following paragraph

 

# means sync every 10 minutes

 

 

#crontab -e 

 

*/10 * * * *  /usr/sbin/ntpdate -u cn.pool.ntp.org >/dev/null 2>&1

 

#systemctl restart crond

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326088247&siteId=291194637