安装ntpdate
yum -y install ntpdate
查看当前时间
date
同步当前时间
ntpdate time.nist.gov; #更新时间 hwclock -w; #将时间写入到硬盘
加入定时任务
1.打开crontab vi /etc/crontab 2.加入定时任务 * */48 * * * ntpdate time.nist.gov;hwclock -w;
yum -y install ntpdate
date
ntpdate time.nist.gov; #更新时间 hwclock -w; #将时间写入到硬盘
1.打开crontab vi /etc/crontab 2.加入定时任务 * */48 * * * ntpdate time.nist.gov;hwclock -w;