首页 > 其他 > 详细

centos7 时间同步

时间:2018-06-03 12:16:37      阅读:197      评论:0      收藏:0      [点我收藏+]
设置开机自动同步Internet时间,并作定时同步任务
1、修改时区

rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
vim /etc/sysconfig/clock
ZONE="Asia/Shanghai"
UTC=false
ARC=false

2、安装并设置开机自启

yum install -y ntp
systemctl start ntpd
systemctl enable ntpd

3、配置开机启动校验

vim /etc/rc.d/rc.local
/usr/sbin/ntpdate ntp1.aliyun.com > /dev/null 2>&1; /sbin/hwclock -w

4、配置定时任务

crontab -e
0 */1 * * * ntpdate ntp1.aliyun.com > /dev/null 2>&1; /sbin/hwclock -w

centos7 时间同步

原文:http://blog.51cto.com/10764724/2123594

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