Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of using NTP to adjust system time when system time is out of order

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the method of using NTP to adjust the system time when the system time is out of order". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

When we use the computer, we sometimes find that the time of the system is out of order. So how to make the system time accurate? Today, the editor will teach you a simple way to use NTP to adjust the system time.

NTP is the abbreviation of Network Time Protocol, which means "Network time Protocol". It is a time synchronization protocol implemented by TCP/IP protocol.

Ubuntu automatically goes to ntp.ubuntu.com to do time synchronization every time it starts. However, since the server generally does not start frequently, the time deviation cannot be avoided, and this deviation can be large. Therefore, we need to correct the server's time from time to time. The most convenient way is to synchronize time once a day with the help of cron's scheduled tasks.

Solution:

1. Create a file / etc/cron.daily/timeupdate:

_ FCKpd___0nbsp;sudo nano / etc/cron.daily/timeupdate

two。 Enter the following:

Ntpdate ntp.ubuntu.com

3. After you save the file, you also need to give it executable permissions:

_ FCKpd___2nbsp;sudo chmod 755 / etc/cron.daily/timeupdate

In this way, the system can go to ntp.ubuntu.com every day to get the time (all tasks in the / etc/cron.daily/ directory are executed once a day) and calibrate the time of the server itself. If you are worried about the failure of time acquisition, you can add multiple NTP servers to the / etc/cron.daily/timeupdate file:

Ntpdate ntp.ubuntu.com pool.ntp.org

This is the end of the content of "the method of using NTP to adjust the system time when the system time is out of order". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report