Centos 7.2 时间同步

安装 ntpdate  ,  yum -y install ntpdate 

#ntpdate cn.pool.ntp.org

删除本地时间并设置时区为上海

 

rm -rf /etc/localtime

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

扫描二维码关注公众号,回复: 203882 查看本文章

 

自动同步时间

#添加下面一段

#表示每10分钟同步一次

#crontab -e 

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

#systemctl restart crond

猜你喜欢

转载自freeittech.iteye.com/blog/2408517