This document describes the use of the NTP Project's sntp
program,
that can be used to query a Network Time Protocol (NTP) server and
display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
This document applies to version 4.2.7p84 of sntp
.
The program implements the SNTP protocol as defined by the draft NTPv4 IETF specification.
.I sntp implements the Simple Network Time Protocol, and is used to query an NTP or SNTP server and either display the time or set the local system's time (given suitable privilege).
It can be run interactively from the command line or as a .I cron job.
NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC 1305.
This section was generated by AutoGen, the aginfo template and the option descriptions for the sntp program. It documents the sntp usage text and option meanings.
This software is released under a specialized copyright license.
This is the automatically generated usage text for sntp:
sntp is unavailable - no --help
* Usage:: Usage
By default, sntp
writes the local data and time (i.e., not UTC) to the
standard output in the format:
1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
where the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.
The simplest use of this program is as an unprivileged command to check the current time, offset, and error in the local clock. For example:
sntp ntpserver.somewhere
With suitable privilege, it can be run as a command or in a
crom
job to reset the local clock from a reliable server, like
the ntpdate
and rdate
commands.
For example:
sntp -a ntpserver.somewhere