NTPLEAPFETCH(8)

✨ NAME ✨

ntpleapfetch β€” the leap-seconds file manager/updater, aka your girl who keeps your leap second file cute and current πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

ntpleapfetch
    [-46] [-c command] [-e expiry] [-f config] [-F] [-h]
        [-i interval] [-l] [L] [-p {4|6}] [-P logfacility] [-q]
        [-r retries] [-s source-url] [-t path] [-v] [-z path]
        [-Z] [leapfile] [-V | --version] [filename]

(and yes bestie, that [L] in there is literally how it's written in the manual β€” no dash, no cap, we don't ask questions, we just report the facts πŸ™ˆ)


🌸 DESCRIPTION 🌸

So ntpleapfetch is gonna validate whatever leap second file is chilling on your local system rn, and if it needs to, it updates that leap second definition file. That's it, that's the job. πŸ’…

Normally the file gets found through the "leapfile" directive in ntp.conf(5). But lowkey you can also just point it at an alternate location right on the command line if you wanna be different.

Now here's the tea: if the file doesn't exist, or it isn't valid, or it has expired, or it's about to expire soon, then a brand new copy gets downloaded. And if that new copy validates? It gets installed and NTP is (optionally) restarted. Slay. ✨

But if the current file is perfectly acceptable? Then literally nothing happens β€” no download, no restart. Respect the peace. 🧘

-c can also be used to invoke another script to do your little administrative side quests, e.g. copying the file to other local systems. Main character energy for sure.

You can run this as a cron job! And since the file is rarely updated, and leap seconds are announced at least one month in advance (usually longer, ngl), you really don't need to run it more often than about once every three weeks. She's low maintenance like that. πŸŽ€

For cron-friendly behavior, define CRONJOB=1 in the crontab. Periodt.


πŸ’… OPTIONS πŸ’…

  • -4 β€” Use only IPv4 addresses for DNS name resolution. Heads up though: this option must not appear in combination with -6. Pick a lane bestie, you can't have both.
  • -6 β€” Use only IPv6 addresses for DNS name resolution. And same rule: this one must not appear in combination with -4.
  • -c β€” Command to restart ntpd after installing a new file. If you don't give it a command like that, then ntpd just checks the file daily on its own. She's independent, okay?
  • -e expiry β€” Refresh the leapfile this long before it expires. Basically you're specifying how long before expiration the file should be refreshed. Units are required, e.g. "-e 60 days". And ngl, larger values imply more frequent refreshes β€” think about it, the earlier you want to refresh before expiry, the more often you're doing it. Math is mathing. πŸ”₯
  • -f config β€” Location of the ntp.conf file. Specify where ntp.conf lives, and it defaults to /etc/ntp.conf. It gets read to make sure the "leapfile" directive is actually present, and to figure out the default path to the leapfile.
  • -F β€” Force update even if current file is OK and not close to expiring. Chaotic? Maybe. Effective? Also yes.
  • -i interval β€” Number of minutes between retries.
  • -h β€” Display inline help. Your little rescue button. 🫢
  • -l β€” Use syslog for output. (This is implied if CRONJOB is set.)
  • -L β€” Don't use syslog for output.
  • -p {4|6} β€” Prefer IPv4 or IPv6 (as specified) addresses, but use either. So she has a favorite, but she's not gonna be dramatic about it.
  • -P logfacility β€” Specify the syslog facility for logging.
  • -q β€” Only report errors to stdout. Quiet queen. 🀫
  • -r retries β€” Number of retries.
  • -s source-url β€” The URL of the master copy of the leapseconds file. That's the source of truth, the blueprint, the blueprint-iest. ⭐
  • -t path β€” Name of temporary file used in validation.
  • -v β€” Verbose output. She will tell you EVERYTHING. 😭
  • -z path β€” Specify path for utilities.
  • -Z β€” Use system path only.
  • -V, --version β€” Print the version string and exit.
  • leapfile β€” An alternate location to download the leapseconds file to.

🌈 EXIT STATUS 🌈

One of these exit values is gonna come back to you, so let's vibe check each one:

  1. 0 (EXIT_SUCCESS) β€” Successful program execution. We ate and left no crumbs. πŸ“
  2. 1 (EXIT_FAILURE) β€” The operation failed or the command syntax was not valid. Rough, but recoverable.
  3. 2 β€” Internal error - restart command failed. πŸ’€

πŸ‘‘ AUTHORS πŸ‘‘

Timothe Litt


This whole page is brought to you by the NTPsec girlies, dated 2026-10-21. Stay leaping, stay fresh, and go update that file bestie πŸ’œπŸ§š

πŸ“¦ where this page comes from