Linux Obtaining the Correct Time

From Marvel vs DC
Revision as of 01:26, 20 April 2021 by Hahnbooth2 (talk | contribs) (Created page with "Ensuring a computer isn't just displaying the right time but that it's being maintained accurately is not as straight-forward since it first sounds.<br /><br />Most Linux syst...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ensuring a computer isn't just displaying the right time but that it's being maintained accurately is not as straight-forward since it first sounds.

Most Linux systems have two clocks. The hardware clock, generally known as the CMOS of Bios clock, is usually a simple crystal oscillator with battery back-up that maintains time when your system is off or boots up. This clock is usually located on the motherboard and will run on a regular basis, however these clock chips tend to lose time as the computer ages and the battery weakens.

The other clock, the machine clock, is a software clock and it starts once you boot up one's body often getting a first time from the hardware clock. System clocks keep time with the addition of seconds to a prime epoch, a base time that for Linux and Unix, began at midnight on January 1, 1970.

However, the hardware clock is a cheap electronic oscillator and cannot maintain time and energy to any useful degree of accuracy. They often drift several seconds a day which for day-to-day process is most likely adequate but as time passes sensitive applications it could cause serious problems.

A better way is to set the system clock using the time from a NTP (Network Time Protocol) time server. These dedicated time servers get yourself a UTC (Coordinated Universal Time) time from an atomic clock which will be the most accurate time keepers on earth, not losing a second in time in several millions of years.

Dedicated NTP servers use either a radio receiver to pick-up a radio time and frequency broadcast which are transmitted by several national laboratories or utilizing the timing signal broadcast from the GPS network.

Linux uses a NTP service called NTP Daemon (ntpd). This uses NTP to regulate the system clock for just about any drift in time as it frequently check the UTC time source.

To configure the NTP daemon the ntp.conf file in the /etc directory may be used. From here more than one time server may be used as a reference plus the frequency it is checked can be altered.