yum install ntp -y
ntpdate time1.aliyun.com
hwclock --systohc
执行
crontab -e
出现输入界面,输入下面这行(每天早上8点执行一次时间同步)
0 0 8 * * ? /usr/sbin/ntpdate time1.aliyun.com > /dev/null 2>&1
cron表达式可以根据各自需求改
yum install ntp -y
ntpdate time1.aliyun.com
hwclock --systohc
执行
crontab -e
出现输入界面,输入下面这行(每天早上8点执行一次时间同步)
0 0 8 * * ? /usr/sbin/ntpdate time1.aliyun.com > /dev/null 2>&1
cron表达式可以根据各自需求改