yum安装ntpdate
yum install -y ntpdate
删除本地时间并更改时区为上海
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
和时间服务器同步
ntpdate time.nist.gov
添加计划任务
vi /etc/crontab
添加一行
00 0 1 * * root ntpdate time.nist.gov
yum安装ntpdate
yum install -y ntpdate
删除本地时间并更改时区为上海
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
和时间服务器同步
ntpdate time.nist.gov
添加计划任务
vi /etc/crontab
添加一行
00 0 1 * * root ntpdate time.nist.gov