首页 > 系统服务 > 详细

linux系统初始化--​配置ntp自动更新时间

时间:2017-01-12 16:20:44      阅读:231      评论:0      收藏:0      [点我收藏+]

配置ntp自动更新时间

安装ntpdate程序

Shell># yum –y install ntpdate

使用crontab将系统设定为每天0:00与NTP服务器同步时间

Shell># crontab –e

0   0  *  *  *  ntpdate   your_ntp_server_domain_name   or  your_ntp_server_ip_addr

保存退出,

为了我们步骤继续下去,我们执行一次同步

Shell># ntpdate ntp.jn.idc

如果成功会有如下提示

Shell># ntpdate ntp.jn.idc

18 Jul 15:34:31 ntpdate[8655]: step  time server ntp.jn.idc offset -29.884509 sec

将系统时间同步到硬件

Shell># hwclock –w

验证

Shell># date

Sat Jul 18 09:00:47 CST 2015

如果输出的时间没有问题,表示成功


本文出自 “蓝色之翼” 博客,请务必保留此出处http://wqlszy2016.blog.51cto.com/2668358/1891347

linux系统初始化--​配置ntp自动更新时间

原文:http://wqlszy2016.blog.51cto.com/2668358/1891347

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!