Centos 自动同步时间设置


1,安装ntpdate 服务器,一般系统自带,没有就yum -y install ntpdate

2,设置服务器时区-上海时间为例子

[root@localhost ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

3,向时间服务器请求数据同步

[root@localhost ~]# ntpdate us.poll.ntp.org

时间时间基本完成

4,自动同步 加入crontab 自动计划中

[root@localhost ~]# crontab -e

0-59/5 * * * * /usr/sbin/ntpdate us.pool.ntp.org
#5 分钟请求一次

image.png

最后记得启动下计划任务:

image.png

[root@localhost ~]# chkconfig crond on

加入自启动

上一篇

评论



分享

热门文章

最新加入

最新评论

ss就这样吧: 还是用原声的写吧,这样就不会出现兼容性的问题了 。 查看原文 05月25日 15:55
指尖: 数据库主从配置 查看原文 03月03日 11:26




kefu
0.0522s