[] LINUX operating system clock and the hardware clock settings

When Linux boots, the system clock to read the hardware clock setting, after the system clock that is independent.

man hwclock 写道

The System Time is the time that matters. The Hardware Clock’s basic purpose in a Linux system is to keep time
when Linux is not running. You initialize the System Time to the time from the Hardware Clock when Linux
starts up, and then never use the Hardware Clock again. Note that in DOS, for which ISA was designed, the
Hardware Clock is the only real time clock.


man hwclock 还写道

It is important that the System Time not have any discontinuities such as would happen if you used the date(1L)
program to set it while the system is running. You can, however, do whatever you want to the Hardware Clock
while the system is running, and the next time Linux starts up, it will do so with the adjusted time from the
Hardware Clock.



If you use the date command to change the system time, and does not automatically go to modify the hardware clock, so when the next system reboot, the system clock will pick up from the hardware clock, time, date set is invalid. This is probably the reason why hwclock command it.
Common parameters

  -r, --show read and print hardware clock (Clock and Read Hardware Print Result)
  -s, --hctosys hardware clock is synchronized to the system clock (SET The System Time Clock from The Hardware)
  -w, - systohc the system clock is synchronized to the hardware clock (set the hardware clock to the current system time)

-- < END > --

 

Guess you like

Origin www.cnblogs.com/fengaix6/p/11773513.html