The relationship between system time and RTC time in Linux

Source: Internet
Author: User

Excerpt from: The relationship between system time and RTC time in Http://www.yunweipai.com/archives/208.html?utm_source=tuicool&utm_medium=referralLinux2012-08-12 09:08 reading 4.4k Comments 0

2017 Gdevops Global Agile Operations Summit-Chengdu Station (limited time offer), Yun Dimensional as the sponsor of this summit, you can click here to learn more

RTC (Real-time clock), translated by real-time clock chip, specifically no longer explained, interested in direct Baidu search under it.
For a server with an operating system installed, the operating system and server hardware itself are recording and updating the current time, which means that the system time and RTC time are two separate sets of timing mechanisms, but they are interdependent:

1) After the initial installation of the operating system, if the installation process does not set the system time, then the default system time is from the server's RTC to obtain the current hardware time;
2) After modifying the system time in the operating system, the OS will usually update the system time to RTC when restarting or shutting down the Linux system;
3) When the operating system is started again, the Linux OS will get the current time from the RTC again.

Simply put,--RTC time is the real continuous update, and the operating system is only after the system startup will continue to update, during the operating system shutdown or restart, even during the server power down, the entire server time depends on the RTC.

The above explanation is a bit around the mouth, then, this phenomenon should pay special attention to:

Server abnormal power down, after the operating system restarts, found that the system time has changed?

The reason is usually: modify the operating system time, after the server abnormal power down, the operating system did not promptly update the modified time to the RTC, resulting in the OS restart, the previous "old" time from the RTC, so at the operating system level is reflected as "time jump".

For this phenomenon, the strategy is: when we modify the system time with the date command on the operating system, it is important to remember to execute the following command to flush the system time to RTC:

# HWCLOCK–SYSTOHC

The relationship between system time and RTC time in Linux

Related Article

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.