HTPDATE(8)
π HTPDATE(8) π
okay bestie, we're doing the htpdate manual page today β that's section 8 of the System Manager's Manual, so you know it's giving daemon energy. Time synchronization, but make it HTTP. Let's get into it. πβ¨
πΈ NAME πΈ
htpdate β Time synchronization (daemon)
like, it syncs your time. as a daemon. that's the whole vibe. π«Ά
β¨ SYNOPSIS β¨
htpdate [-046acdhlnqstvxDF] [-f driftfile] [-i pidfile] [-m minpoll] [-M
maxpoll] [-p precision] [-P <proxyserver>[:port]] [-u user[:group]]
<URL> ...
so many little flags, so much power. iconic behavior fr fr π
π¦ DESCRIPTION π¦
The HTTP Time Protocol (aka HTP, the moment) is how you synchronize a computer's time using web servers as your reference time source. Htp will sync your computer's time using the Greenwich Mean Time (GMT) HTTP headers timestamp from web servers. And the bestie moment? HTTP and HTTPS are both supported. π₯
The htpdate package includes a program for retrieving the date and time from remote machines via a network. Htpdate works through proxy servers β yes, it goes through the proxy, it's very adaptable like that. π
Accuracy of htpdate will usually be within 0.5 seconds (better with multiple servers). And if that's not good enough for you? No shade, but go use an ntp package like ntpd, OpenNTPD or chrony. Different tool, different slay.
π OPTIONS π
-0β HTTP/1.0 request (default is HTTP/1.1). old school, but valid. π-4β Force IPv4 name resolution only. Default behaviour is to try IPv6 first and fall back to IPv4.-6β Force IPv6 name resolution only. v6 girlies rise. π-aβ Adjust time smoothly (default in daemon mode). no sudden jumps, just a gentle lil glide. β¨-cβ Verify server certificate (default no verification). secure girlie mode. π-dβ Turn debug on. Shows the"raw"timestamp, round trip time, time delta and and basic statistics of web server responses. Useful to determining the quality of a specific web server as time source. Multiple-doptions increase verbosity. The maximum is 3.-fβ Read/write the systematic drift of the system clock. See also-x.-hβ Show help. (hi bestie π)-iβ Set the pid file (default/var/run/htpdate.pid).-lβ Use syslog for output (levelsLOG_WARNINGandLOG_INFO). Convenient if you use htpdate from cron.-m-Mβ These options specify the minimum (-m) and maximum (-M) polling intervals for HTP requests, in seconds. The default range is between 30 minutes and 32 hours. Htpdate calculates the optimal polling frequency between minimum and maximum values. Only applicable when running in daemon mode.-nβ Don't use a proxy, even if the appropriatehttp_proxyenvironment variable is defined. not today, proxy.-pβ Precision determines the operating accuracy of htpdate. Precision specifies the number of steps (default 4, maximum of 9) for htpdate to determine the second boundary.-qβ Query web server and display time, but do not change time (default in interactive mode). look but don't touch energy. π-sβ Set time immediate. In daemon mode-sonly applies the first poll.-tβ Turn off sanity time check. By default a time offset larger than a year, compared to current localtime, is rejected. With-tset, any time stamp will be accepted. β οΈ yeah that's the "trust literally anything" flag, proceed with intention.-uβ Set the user and group that the server normally runs at (default is root).-vβ Show version.-xβ Let htpdate compensate for the systematisch clock drift by adjusting system clock frequency.-Dβ Run as daemon. This option requires root privileges. π-Fβ Run daemon in foreground. Daemon will not fork or write PID file. This option requires root privileges. π-Pβ Proxy server hostname or IP address.hostβ Web server hostname or IP address. Up to 16 hosts may be specified, but in general 3 to 5 hosts should be enough for a redundant and accurate setup.portβ Port number (default 80 and 8080 for proxy server).pathβ Path to resource (e.g./index.html).
π ENVIRONMENT π
Htpdate supports proxies for HTTP connections. The standard way to specify the proxy location, which htpdate recognizes, is using the following environment variable:
http_proxyβ If set, thehttp_proxyvariable should contain the URL of the proxy for HTTP connections.
π EXAMPLES π
Request time from web server (don't update local clock):
htpdate www.example.com
Request time from multiple web servers:
htpdate www.example.com https://example.com http://example.com:80
Debug output (don't update local clock):
htpdate -d www.example.com
Adjust time smoothly and log output to syslog (eg. cron):
htpdate -al www.example.com:80/htpdate.html
HTTP/1.0 request in IPv6 literal format (RFC 2732):
htpdate -0 [2001:db8:1af6::123]:80
Run htpdate as daemon:
htpdate -D https://www.example.com
Run htpdate in the foreground with all output going to the terminal:
htpdate -F www.example.com
Read clock drift during start of htpdate and update when a new value has been established:
htpdate -Dx -f /etc/htpdate.drift www.example.com
Daemon mode for the security minded:
htpdate -D -u nobody:nogroup www.example.com
π«Ά AUTHOR π«Ά
Eddy Vervest <eddy@vervest.org>, http://www.vervest.org/htp
β SEE ALSO β
rdate, timed, ntpd, OpenNTPD, chrony, adjtimex(8), ntp_adjtime,
and that's the whole page, bestie!! π this little masterpiece is htpdate version 2.0.0, and it lives in the System Manager's Manual as HTPDATE(8). go sync something. slay. π¦πΈπ
π¦ where this page comes from
- alpine 3.24: htpdate-doc 2.0.0-r0 Β· GPL-2.0-or-later
- ubuntu resolute: htpdate 2.0.0-5ubuntu1 Β· GPL-2.0-or-later
- ubuntu stonking: htpdate 2.0.0-5ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms