CentOS时间较准(或者同步)
1、安装ntp
yum -y install ntp
2、开机自动启动
chkconfig ntpd on
service ntpd start
3、网络时间较准
ntpdate cn.ntp.org.cn
4、设置上海时间
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
5、重启服务
service ntpd restart
6、定时任务(crontab -e)
# 每隔5分钟同步一次网络时间
*/5 * * * * /usr/sbin/ntpdate cn.ntp.org.cn