# 安装ntpdate
yum -y install ntpdate
# 查看状态
[root@Temp webapps_logs]# systemctl status ntpdate
● ntpdate.service - Set time via NTP
Loaded: loaded (/usr/lib/systemd/system/ntpdate.service; disabled; vendor preset: disabled)
Active: inactive (dead)
# 校准时间
[root@Temp webapps_logs]# /sbin/ntpdate ntp1.aliyun.com
22 Dec 11:00:44 ntpdate[18924]: step time server 120.25.115.20 offset 514.579480 sec
# 添加定时任务 内容:*/3 * * * * /sbin/ntpdate ntp1.aliyun.com
crontab -e
# 查看定时任务
[root@Temp webapps_logs]# crontab -l
*/1 * * * * /etc/init.d/zxops_agent checkdown
*/3 * * * * /sbin/ntpdate ntp1.aliyun.com
您在 /var/spool/mail/root 中有邮件
服务器自动校准时间
最新推荐文章于 2024-03-25 10:31:21 发布