Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set Network time synchronization by Linux

Shulou Source: shulou.com Published: 2022-06-02 00:42:14 10月02日 Update

Linux how to set up network time synchronization, in response to this problem, this article details the corresponding analysis and solution, hoping to help more small partners who want to solve this problem find a simpler and easier way.

Linux time is divided into System Clock and Real Time Clock (RTC).

System time: refers to the time in the current Linux Kernel.

Hardware time: The time when battery power is available on the motherboard.

Command to view system time: #date Command to set system time: #date-set (MM/DD/YYY: MM: SS) Example: #date-set "10/11/10 10:15" Command to view hardware time: #hwclock Command to set hardware time: # hwclock-set-date =(MM/DD/YYY: MM: SS) The above mentioned is to manually set the time to a point in time, which may be different from the current network time. Here's how to synchronize with time on a time server

Install ntpdate tool

yum -y install ntp ntpdate

Set system time to synchronize with network time

ntpdate cn.pool.ntp.orgor => ntpdate -u ntp.api.bz

Write system time to hardware time

hwclock –w

4. When viewing hardware

Linux is a free-to-use and freely distributed UNIX-like operating system, a POSIX-based multiuser, multitasking, multithreaded, and multiCPU operating system that runs major Unix tools, applications, and network protocols.

About Linux how to set up the network time synchronization problem answer to share here, I hope the above content can have some help for everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

Tags: Time system hardware network synchronization commands questions operating systems tools methods more help answers easy free easy motherboard tasks content guys Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Docker MySQL NVidia Huawei