rdate(8)

πŸ“¦
version 1.11 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– rdate(8) β€” set the system's date from a remote host πŸ’–

okay bestie, welcome to rdate, the little tool that goes "hey remote host, what time is it?" and then fixes your clock accordingly. it lives in section 8 of the manual, she's a system admin girlie πŸ’…


✨ NAME ✨

rdate β€” set the system's date from a remote host πŸ•°οΈ


🌸 SYNOPSIS 🌸

rdate [-46acnpsuv] [-b sec] [-o port] [-t msec] host

πŸ¦‹ DESCRIPTION πŸ¦‹

rdate displays and sets your local date and time using the host name or address you hand it as the argument. no cap, that's the whole job.

the time source can be one of two things, and she's flexible like that:

  • an RFC 868 TCP protocol server β€” usually just chillin' as a built-in service of inetd(8)
  • an RFC 5905 protocol SNTP/NTP server ✨

by default, rdate uses the RFC 868 TCP protocol. that's her default setting, periodt.

OpenRdate supports both IPv4 and IPv6 protocols, so she's not picky about your whole address situation πŸ’–


πŸ‘‘ OPTIONS πŸ‘‘

  • -4 β€” force rdate to use IPv4 addresses only.
  • -6 β€” force rdate to use IPv6 addresses only.
  • -a β€” use the adjtime(2) call to gradually skew the local time toward the remote time instead of just hopping there. it's giving gentle, it's giving smooth 🧚
  • -b sec β€” use adjtime if the clock difference is at most sec seconds, or hop if the difference is greater. basically this is the same as adding or removing the -a option, decided by the clock difference itself. lowkey smart.
  • -c β€” correct leap seconds. sometimes required when you're synchronizing to an NTP server. when you're synchronizing using the RFC 868 protocol, only use this option if the server does not correctly account for leap seconds. and how do you know if you need it? you can determine that if you sync against an NTP server (with this parameter), or β€” and this is the recommended way β€” check with a local radio controlled watch or phone service ⏰
  • -n β€” use SNTP (old RFC 2030, currently RFC 5905) instead of the RFC 868 time protocol. SNTP will always use UDP protocol and its default port is 123.
  • -o port β€” use port port instead of port 37 (RFC 868) or 123 (SNTP, RFC 5905).
  • -p β€” do not set, just print the remote time. look but don't touch energy πŸ™ˆ
  • -s β€” do not print the time. silent but deadly.
  • -u β€” use UDP instead of TCP as transport (for RFC 868 only; see the -n option).
  • -t msec β€” does not set time if it took more than msec milliseconds to fetch time from the network. girl has a timeout and she's not afraid to use it πŸ’€
  • -v β€” verbose output. always show the adjustment.

πŸŽ€ FILES πŸŽ€

  • /var/log/wtmp β€” record of date resets and time changes. she keeps receipts πŸ“

🌈 EXAMPLES 🌈

to get the legal time in Germany, set the /etc/localtime symlink to /usr/share/zoneinfo/right/Europe/Berlin and issue the following command:

# rdate -ncv ptbtime1.ptb.de

the command of course assumes you have a working internet connection and DNS set up to connect to the server at Physikalisch-Technische Bundesanstalt in Braunschweig, Germany.

the gradual glow-up, hourly ✨

to gradually adjust time once an hour after the first "step" adjustment, put the following line into root's crontab:

58  *  *  *  *  rdate -ncav ptbtime1.ptb.de | logger -t NTP

the ssh tunnel situation πŸš‡

to set the time through an ssh tunnel, use something like so:

ssh -f -L 10037:time.example.com:37 tyr.example.com sleep 10
rdate -a -o 10037 localhost

πŸ’œ SEE ALSO πŸ’œ

date(1), adjtime(2), inetd(8), ntpd(8), ntpdate(8), timed(8)


🫢 AUTHORS 🫢

OpenRdate was originally developed by David Snyder and was based in rdate, created by Christos Zoulas in 1994 for the OpenBSD Project. over time, OpenRdate got several contributions from people πŸ«‚

this manual page was written by Christos Zoulas. it was changed by Anibal Monsalve Salazar for the Debian Project and updated by Joao Eriberto Mota Filho.


and that's the whole page bestie πŸ’– she's rdate-1.11, dated 14 Feb 2022 β€” yes, a valentine's day release, because setting your clock from a remote host is literally self-care 🌸✨ slay, sync, and stay on time πŸ‘‘πŸ¦‹