linux时间自动同步

1,修正本地时区及ntp服务


#yum -y install ntp
#rm -rf /etc/localtime
#ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#/usr/sbin/ntpdate -u pool.ntp.org
2,自动同步时间
#添加下面一段
#表示每10分钟同步一次


#crontab -e
*/10 * * * * /usr/sbin/ntpdate -u pool.ntp.org >/dev/null 2>&1
#service crond restart

posted @ 2016-10-24 16:15  记忆残留  阅读(535)  评论(0编辑  收藏  举报