博客详情

centos更新系统时间(网络时间同步) (原创)

作者: 朝如青丝暮成雪
发布时间:2018-12-05 11:55:17  文章分类:java编程   阅读(1033)  评论(0)

/usr/sbin/ntpdate  us.pool.ntp.org     与网络服务器同步时间一次


制作定时任务,每隔10秒同步更新一次时间:
crontab  -e 
*/10 * * * * /usr/sbin/ntpdate  us.pool.ntp.org | logger -t NTP

重启定时服务
service crond restart  


###在没有连通外网情况下

date -s 20181010  #修改系统日期

date -s 10:20:20  #修改系统时间


  

关键字:  系统时间  网络时间同步
评论信息
暂无评论
发表评论

亲,您还没有登陆,暂不能评论哦! 去 登陆 | 注册

博主信息
   
数据加载中,请稍候...
文章分类
   
数据加载中,请稍候...
阅读排行
 
数据加载中,请稍候...
评论排行
 
数据加载中,请稍候...

Copyright © 叮叮声的奶酪 版权所有
备案号:鄂ICP备17018671号-1

鄂公网安备 42011102000739号