192 lines
3.3 KiB
HTML
192 lines
3.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>When the clock is wrong</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux System Administrators Guide"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Keeping Time"
|
|
HREF="keeping-time.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Showing and setting time"
|
|
HREF="showing-setting-time.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="NTP - Network Time Protocol"
|
|
HREF="ntp.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux System Administrators Guide: </TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="showing-setting-time.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 14. Keeping Time</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="ntp.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="CLOCK-WRONG"
|
|
></A
|
|
>14.4. When the clock is wrong</H1
|
|
><P
|
|
> The Linux software clock is not always accurate. It is
|
|
kept running by a periodic <I
|
|
CLASS="GLOSSTERM"
|
|
>timer interrupt</I
|
|
>
|
|
generated by PC hardware. If the system has too many processes
|
|
running, it may take too long to service the timer interrupt, and
|
|
the software clock starts slipping behind. The hardware clock
|
|
runs independently and is usually more accurate. If you boot
|
|
your computer often (as is the case for most systems that aren't
|
|
servers), it will usually keep fairly accurate time. </P
|
|
><P
|
|
> If you need to adjust the hardware clock, it is usually
|
|
simplest to reboot, go into the BIOS setup screen, and do it
|
|
from there. This avoids all trouble that changing system time
|
|
might cause. If doing it via BIOS is not an option, set the new
|
|
time with <B
|
|
CLASS="COMMAND"
|
|
>date</B
|
|
> and <B
|
|
CLASS="COMMAND"
|
|
>clock</B
|
|
>
|
|
(in that order), but be prepared to reboot, if some part of the
|
|
system starts acting funny. </P
|
|
><P
|
|
> Another method would be to use either <B
|
|
CLASS="COMMAND"
|
|
>hwclock -w</B
|
|
>
|
|
or <B
|
|
CLASS="COMMAND"
|
|
>hwclock --systohc</B
|
|
> to sync the hardware clock
|
|
to the software clock. If you want to sync your software clock to your
|
|
hardware clock then you would use <B
|
|
CLASS="COMMAND"
|
|
>hwclock -s</B
|
|
> or
|
|
<B
|
|
CLASS="COMMAND"
|
|
>hwclock --hwtosys</B
|
|
>. For more information on this
|
|
command read <B
|
|
CLASS="COMMAND"
|
|
>man hwclock</B
|
|
>.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="showing-setting-time.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="ntp.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Showing and setting time</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="keeping-time.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>NTP - Network Time Protocol</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |