Due to server time errors, the following methods can be used to update the Linux server's system time:
Method One:
1, first Yum installs local ntpdate client, updates ntpdate cn.pool.ntp.org when using
[email protected] ~]# Yum install ntpdate
2, update with Ntpdate cn.pool.ntp.org.
[Email protected] ~]# ntpdate cn.pool.ntp.org
Sep 16:46:32 ntpdate[15965]: Adjust time server 202.112.29.82 offset 0.010499 sec
Or use cn.pool.ntp.org's IP address to update.
[[email protected] ~]# ping cn.pool.ntp.org
PING cn.pool.ntp.org (202.112.10.36) bytes of data.
Bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=1 ttl=44 time=107 ms
Bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=2 ttl=44 time=86.2 ms
Ntpdate
[[email protected] ~]# Ping cn.pool.ntp.org
PING cn.pool.ntp.org (202.112.10.36) bytes of data.
Bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=1 ttl=44 time=107 ms
Bytes from gus.buptnet.edu.cn (202.112.10.36): icmp_seq=2 ttl=44 time=86.2 ms
[Email protected] ~]# ntpdate 202.112.10.36
Sep 16:49:14 ntpdate[15966]: Adjust time server 202.112.10.36 offset 0.010657 sec
3, After the update, use CLOCK-W or hwclock-w to write to the BIOS, so that the time will be updated automatically at the next boot.
[Email protected] ~]# clock-w
Method Two:
Update directly with the command, Ntpdate time-a.nist.gov
[Email protected] ~]# ntpdate time-a.nist.gov
This article is from the "Breght Moon" blog, make sure to keep this source http://liqingbiao.blog.51cto.com/3044896/1695013
How to update the system time of a Linux server