Remove unnecessary .Nm arguments.
[dragonfly.git] / usr.sbin / rdate / rdate.8
1 .\"     $OpenBSD: src/usr.sbin/rdate/rdate.8,v 1.29 2004/07/09 19:33:08 jmc Exp $
2 .\"     $NetBSD: rdate.8,v 1.4 1996/04/08 20:55:17 jtc Exp $
3 .\"     $DragonFly: src/usr.sbin/rdate/rdate.8,v 1.2 2007/07/29 17:27:46 swildner Exp $
4 .\"
5 .\" Copyright (c) 1994 Christos Zoulas
6 .\" All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"     This product includes software developed by Christos Zoulas.
19 .\" 4. The name of the author may not be used to endorse or promote products
20 .\"    derived from this software without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .\"
33 .Dd April 30, 1994
34 .Dt RDATE 8
35 .Os
36 .Sh NAME
37 .Nm rdate
38 .Nd set the system's date from a remote host
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl 46acnpsv
42 .Ar host
43 .Sh DESCRIPTION
44 .Nm
45 displays and sets the local date and time from the
46 host name or address given as the argument.
47 The time source may be an RFC 868 TCP protocol server,
48 which is usually implemented as a built-in service of
49 .Xr inetd 8 ,
50 or an RFC 2030 protocol SNTP/NTP server.
51 By default,
52 .Nm
53 uses the RFC 868 TCP protocol.
54 .Pp
55 The options are as follows:
56 .Bl -tag -width Ds
57 .It Fl 4
58 Forces
59 .Nm
60 to use IPv4 addresses only.
61 .It Fl 6
62 Forces
63 .Nm
64 to use IPv6 addresses only.
65 .It Fl a
66 Use the
67 .Xr adjtime 2
68 call to gradually skew the local time to the
69 remote time rather than just hopping.
70 .It Fl c
71 Correct leap seconds.
72 Sometimes required when synchronizing to an NTP server.
73 When synchronizing using the RFC 868 protocol, use this option only if the
74 server does not correctly account for leap seconds.
75 You can determine if you need this parameter if you sync against an NTP
76 server (with this parameter) or (recommended) check with a local radio
77 controlled watch or phone service.
78 .It Fl n
79 Use SNTP (RFC 2030) instead of the RFC 868 time protocol.
80 .It Fl p
81 Do not set, just print the remote time.
82 .It Fl s
83 Do not print the time.
84 .It Fl v
85 Verbose output.
86 Always show the adjustment.
87 .El
88 .Sh FILES
89 .Bl -tag -width /var/log/wtmp -compact
90 .It Pa /var/log/wtmp
91 record of date resets and time changes
92 .El
93 .Sh EXAMPLES
94 To get the legal time in Germany, set the
95 .Pa /etc/localtime
96 symlink to
97 .Pa /usr/share/zoneinfo/right/Europe/Berlin
98 and issue the following command:
99 .Pp
100 .D1 Li "# rdate -ncv ptbtime1.ptb.de"
101 .Pp
102 The command of course assumes you have a working internet connection
103 and DNS set up to connect to the server at
104 .Sy Physikalisch-Technische Bundesanstalt
105 in Braunschweig, Germany.
106 .Pp
107 To gradually adjust time once an hour after the first
108 .Qq step
109 adjustment, put the following line into root's crontab:
110 .Pp
111 .D1 Li "58  *  *  *  *  rdate -ncav ptbtime1.ptb.de | logger -t NTP"
112 .Sh SEE ALSO
113 .Xr date 1 ,
114 .Xr adjtime 2 ,
115 .Xr inetd 8 ,
116 .Xr ntpd 8 ,
117 .Xr timed 8