# ntpleapfetch - leap-seconds file manager/updater - man(8) - [phpMan]

[_NTPLEAPFETCH_(8)](https://www.chedong.com/phpMan.php/man/NTPLEAPFETCH/8/markdown)                                NTPsec                                [_NTPLEAPFETCH_(8)](https://www.chedong.com/phpMan.php/man/NTPLEAPFETCH/8/markdown)

## NAME
       ntpleapfetch - leap-seconds file manager/updater

## 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]

## DESCRIPTION
       ntpleapfetch will validate the file currently on the local system and if necessary, update
       leap second definition file.

       Ordinarily, the file is found using the "leapfile" directive in [_ntp.conf(5)](https://www.chedong.com/phpMan.php/man/ntp.conf/5/markdown)_. However, an
       alternate location can be specified on the command line.

       If the file does not exist, is not valid, has expired, or is expiring soon, a new copy will
       be downloaded. If the new copy validates, it is installed and NTP is (optionally) restarted.

       If the current file is acceptable, no download or restart occurs.

       -c can also be used to invoke another script to perform administrative functions, e.g. to
       copy the file to other local systems.

       This can be run as a cron job. As the file is rarely updated, and leap seconds are announced
       at least one month in advance (usually longer), it need not be run more frequently than about
       once every three weeks.

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

## OPTIONS
       -4
           Use only IPv4 addresses for DNS name resolution. This option must not appear in
           combination with -6.

       -6
           Use only IPv6 addresses for DNS name resolution. This option must not appear in
           combination with -4.

### -c
           Command to restart ntpd after installing a new file. Without such a command, ntpd checks
           the file daily.

       -e _expiry_
           Refresh the leapfile this long before it expires.

           Specify how long before expiration the file is to be refreshed. Units are required, e.g.
           "-e 60 days". Note that larger values imply more frequent refreshes.

       -f _config_
           Location of the ntp.conf file.

           Specify location of ntp.conf, which defaults to /etc/ntp.conf. It is read to make sure
           the "leapfile" directive is present and to determine the default path to the leapfile.

### -F
           Force update even if current file is OK and not close to expiring.

       -i _interval_
           Number of minutes between retries.

### -h
           Display inline help.

### -l
           Use syslog for output (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.

       -P _logfacility_
           Specify the syslog facility for logging.

### -q
           Only report errors to stdout.

       -r _retries_
           Number of retries.

       -s _source-url_
           The URL of the master copy of the leapseconds file.

       -t _path_
           Name of temporary file used in validation.

### -v
           Verbose output.

       -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 the following exit values will be returned:

       0 (EXIT_SUCCESS)
           Successful program execution.

       1 (EXIT_FAILURE)
           The operation failed or the command syntax was not valid.

       2
           Internal error - restart command failed.

## AUTHORS
       Timothe Litt

NTPsec                                       2024-04-01                              [_NTPLEAPFETCH_(8)](https://www.chedong.com/phpMan.php/man/NTPLEAPFETCH/8/markdown)
