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