ntpdate(8)
๐ ntpdate(8) ๐ โ System Manager's Manual energy โจ
๐ธ NAME ๐ธ
ntpdate โ the iconic little tool that sets the date and time via NTP, no cap ๐ฐ๏ธโจ
๐ฆ SYNOPSIS ๐ฆ
okay so the whole vibe is:
ntpdate [-46bBdqsuv] [-a key] [-k keyfile] [-o version] [-t timeout]
server [...]
๐ DESCRIPTION ๐
okay bestie, here's the tea โ: ntpdate sets your local date and time by polling the Network Time Protocol (NTP) server(s) you give as the server argument(s), so it can figure out the correct time. It must be run as root on the local host (unless the -q option is used). A number of samples are obtained from each of the servers specified, and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Lowkey important: the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run, and the interval between runs ๐
ntpdate can be run manually whenever you need to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. But listen: it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since ntpdate does not discipline the host clock frequency as does ntpd, the accuracy using ntpdate is limited. fr fr ๐ญ
Time adjustments are made by ntpdate in one of two ways. If ntpdate determines the clock is in error more than 0.5 second, it will simply step the time by calling the system settimeofday() routine. If the error is less than 0.5 seconds, it will slew the time by calling the system adjtime() routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when ntpdate is run by cron every hour or two. slay ๐
ntpdate will, if the -u flag was not specified, decline to set the date if an NTP server daemon (e.g., ntpd) is running on the same host. When running ntpdate on a regular basis from cron as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock. periodt โจ
Note that in contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace. iykyk ๐
๐ OPTIONS ๐
-4โ Force DNS resolution of following host names on the command line to the IPv4 namespace.-6โ Force DNS resolution of following host names on the command line to the IPv6 namespace.-a keyโ Enable the authentication function and specify the key identifier to be used for authentication as the argumentkeyntpdate. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function. ๐-Bโ Force the time to always be slewed using theadjtime()system call. This is the default.-bโ Force the time to be stepped using thesettimeofday()system call, rather than slewed (default) using theadjtime()system call. This option should be used when called from a startup file at boot time.-dโ Enable the debugging mode, in whichntpdatewill go through all the steps, but not adjust the local clock and using an unprivileged port. Information useful for general debugging will also be printed. ๐-k keyfileโ Specify the path for the authentication key file as the stringkeyfile. The default is/etc/ntpsec/ntp.keys. This file should be in the format described inntpd.-o versionโ No longer supported. Used to be for specifying the NTP version on outgoing packets as integer in the range from 1 through 4. Now simply ignored with a warning message. ๐-qโ Query only โ don't set the clock.-sโ Divert logging output from the standard output (default) to the system syslog facility. This is designed primarily for convenience of cron scripts.-t timeoutโ Specify the maximum time waiting for a server response as the valuetimeout, in seconds and fraction. The value is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN.-uโ Directntpdateto use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the-doption always uses unprivileged ports. ๐ฅ-vโ Be verbose. This option will causentpdate's version identification string to be logged.
๐ฉบ DIAGNOSTICS ๐ฉบ
ntpdate's exit status is zero if it found a server and updates the clock, and nonzero otherwise. That's the vibe check: zero = slayed, nonzero = not it ๐ญ
๐ FILES ๐
/etc/ntp.keysโ encryption keys used byntpdate.
๐ AUTHOR ๐
David L. Mills (mills@udel.edu)
This man page was converted from HTML to roff by Fabrizio Polacco <fpolacco@debian.org>.
๐ซถ SEE ALSO ๐ซถ
๐ Cute footer sign-off: source is the System Manager's Manual, the page tag is ntpdate(8), and the footer doesn't show a separate date/version line beyond that โ so that's the whole iconic footer vibe ๐โจ
๐ฆ where this page comes from
- debian trixie: ntpsec-ntpdate 1.2.3+dfsg1-8 ยท NTP
- ubuntu questing: ntpsec-ntpdate 1.2.3+dfsg1-8ubuntu1
- ubuntu resolute: ntpsec-ntpdate 1.2.3+dfsg1-8ubuntu2 ยท NTP
- ubuntu stonking: ntpsec-ntpdate 1.2.3+dfsg1-8ubuntu3 ยท NTP
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms