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
centos下 时间同步设置
最新推荐文章于 2023-09-01 08:00:00 发布