CLOCK(8)

NAME
clock - manipulate the CMOS clock

SYNOPSIS
/sbin/clock [ -u ] -r
/sbin/clock [ -u ] -w
/sbin/clock [ -u ] -s
/sbin/clock [ -u ] -a
/sbin/clock -v

DESCRIPTION
clock manipulates the CMOS clock in variaous ways, allowing it to be read or written, and allowing synchronization between the CMOS clock and the kernel's version of the system time.

OPTIONS

-v  Show clock(8) version number.

-u  Indicates that the CMOS clock is set to Universal Time.

-r  Read CMOS clock and print the result to stdout.

-w  Write the system time into the CMOS clock.

-s  Set the system time from the CMOS clock.

-a  Set the system time from the CMOS clock, adjusting the time to correct for systematic error, and writting it back into the CMOS clock.

-v  Print the clock version number.

    This option uses the file /etc/adjtime to determine how the clock changes. It contains three numbers:
    The first number is the correction in seconds per day (for example, if your clock runs 5 seconds fast each day, the first number should read -5.0).

    The second number tells when clock was last used, in seconds since 1/1/1970.

    The third number is the remaining part of a second that was left over after the last adjustment.

    The following instructions are from the source code:

    a)  create a file /etc/adjtime containing as the first and only line: '0.0 0 0.0'

    b)  run clock -au or clock -a, depending on whether your CMOS is in Universal or Local Time. This updates the second number.

    c)  set your system time using the date command.

    d)  update your CMOS time using clock -wu or clock -w

    e)  replace the first number in /etc/adjtime by your correction.

    f)  put the command clock -au or clock -a in your /etc/rc.local, or let cron(8) start it regularly.

FILES
/etc/adjtime

AUTHORS

V1.0
    Charles Hedrick, hedrick@cs.rutgers.edu, Apr 1992

V1.1
    Modified for clock adjustments, Rob Hooft, hooft@chem.ruu.nl, Nov 1992

V1.2
    Patches by Harald Koenig, koenig@nova.tat.physik.uni-tuebingen.de, applied by Rob Hooft, hooft@EMBL-Heidelberg.DE, Oct 1993

V1.3
    Patches by alan@spri.levels.unisa.edu.au (Alan Modra), and faith@cs.unc.edu (Rik Faith)

V1.4
    More patches by Alan Modra and Rik Faith.

V1.5
    janl@math.uio.no (Nicolai Langfeldt) incorporated patches by dan@gasboy.com (Dan Wilder), fredex@fcshome.stoneham.ma.us (Fred C. Smith). Port to linux/64k by rnhodek@cip.informatik.uni-erlangen.de (Roman Hodek). Port to linux/axp by jestabro@amt.tay1.dec.com (Jay Estabrook) and ost@coments.rwth-aachen.de (Martin Ostermann) and davidm@azstarnet.com (David Mosberger).