centos下 时间同步设置

1,
[root@localhost html]# yum -y install ntpdate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-19.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================
 Package                                 Arch                                   Version                                                 Repository                            Size
===================================================================================================================================================================================
Installing:
 ntpdate                                 x86_64                                 4.2.6p5-19.el7.centos                                   base                                  82 k

Transaction Summary
===================================================================================================================================================================================
Install  1 Package

Total download size: 82 k
Installed size: 121 k
Downloading packages:
ntpdate-4.2.6p5-19.el7.centos.x86_64.rpm                                                                                                                    |  82 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ntpdate-4.2.6p5-19.el7.centos.x86_64                                                                                                                            1/1 
  Verifying  : ntpdate-4.2.6p5-19.el7.centos.x86_64                                                                                                                            1/1 

Installed:
  ntpdate.x86_64 0:4.2.6p5-19.el7.centos                                                                                                                                           

Complete!

2,
[root@localhost etc]# rm -rf /etc/localtime 
3,
[root@localhost etc]# vi /usr/share/zoneinfo/Asia/Shanghai
[root@localhost etc]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4,
[root@localhost etc]# ntpdate us.pool.ntp.org
 9 Jun 13:47:47 ntpdate[5641]: step time server 74.120.8.2 offset -28798.525811 sec

5,
0 23 * * * ntpdate asia.pool.ntp.org >> /var/log/ntpdate.log

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值