How to update the system time of a Linux server

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.