summaryrefslogtreecommitdiffstats
path: root/sys-utils/clock.8
blob: f4dd83ade0bbe7459c3fe167d8c49db2acd242dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
.\" May be distributed under the GNU General Public License
.TH CLOCK 8 "24 December 1992" "Linux 0.99" "Linux Programmer's Manual"
.SH NAME
clock \- manipulate the CMOS clock
.SH SYNOPSIS
.B "/etc/clock [ -u ] -r"
.br
.B "/etc/clock [ -u ] -w"
.br
.B "/etc/clock [ -u ] -s"
.br
.B "/etc/clock [ -u ] -a"
.SH DESCRIPTION
.B 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.
.SH OPTIONS
.TP
.B \-u
Indicates that the CMOS clock is set to Universal Time.
.TP
.B \-r
Read CMOS clock and print the result to stdout.
.TP
.B \-w
Write the system time into the CMOS clock.
.TP
.B \-s
Set the system time from the CMOS clock.
.TP
.B \-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.
.sp
This option uses the file
.I /etc/adjtime
to determine how the clock changes.  It contains three numbers:
.RS
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).
.LP
The second number tells when
.B clock
was last used, in seconds since 1/1/1970.
.LP
The third number is the remaining part of a second that was left over after
the last adjustment.
.LP
The following instructions are from the source code:
.TP
a)
create a file
.I /etc/adjtime
containing as the first and only line: '0.0 0 0.0'
.TP
b)
run
.I "clock -au"
or
.IR "clock -a" ,
depending on whether your CMOS is in Universal or Local Time.  This updates
the second number.
.TP
c)
set your system time using the
.I date
command.
.TP
d)
update your CMOS time using
.I "clock -wu"
or
.I clock -w
.TP
e)
replace the first number in
.I /etc/adjtime
by your correction.
.TP
f)
put the command
.I "clock -au"
or
.I "clock -a"
in your
.IR /etc/rc.local ,
or let
.BR cron (8)
start it regularly.
.RE
.SH FILES
.I /etc/adjtime
.br
.I /etc/rc.local
.SH AUTHORS
.TP
.B V1.0
Charles Hedrick, hedrick@cs.rutgers.edu, Apr 1992
.TP
.B V1.1
Modified for clock adjustments, Rob Hooft, hooft@chem.ruu.nl, Nov 1992
.TP
.B V1.2 
Patches by Harald Koenig, koenig@nova.tat.physik.uni-tuebingen.de, 
applied by Rob Hooft, hooft@EMBL-Heidelberg.DE, Oct 1993
.sp