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

你可能感兴趣的:(Linux自动同步时间)