# 安装ntpdate rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm yum install ntpdate -y # 更改时区 ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 设置定时任务同步时间 echo 'Asia/Shanghai' > /etc/timezone ntpdate time2.aliyun.com # 加入到crontab crontab -e */5 * * * * /usr/sbin/ntpdate time1.aliyun.com >> /tmp/time.log 2>&1