tai-download-leapseconds -- download the IETF leapseconds file.
tai-download-leapseconds
tai-download-leapseconds http://my.server/foo/leaps.list http://other.server/leaps.list tai-download-leapseconds --help tai-download-leapseconds --quiet --pathname=/etc/leap-seconds.list tai-download-leapseconds --show-url
tai-download-leapseconds iterates through a list of URLs and attempts to download the IETF leapseconds list file, saving it by default to a location where Time::TAI::Simple knows to look for it.
Time::TAI::Simple
By default it writes the pathname of the downloaded file to STDOUT upon success, or an error message to STDERR on failure.
If the user wishes to specify URLs where tai-download-leapseconds should look first, any number of URLs may be specified as command line arguments, which will be checked in order.
These default behaviors may be controlled via some options:
-h Describe available options --help Same as -h --add-agent=<string> Add the specified User-Agent string to the internal list --add-agent=\"<string>|<string>|...\" Add the specified User-Agent strings to the internal list --agent=<string> Use the specified User-Agent string --churn-agent On failure, pick a random User-Agent string for next try (Most useful when --retry=N is set to N > 1) (Does not work with --force-edge) --debug Show annoying descriptions of what it is doing (ignores -q) --force-edge Always use the first User-Agent string in the list (Microsoft Edge, unless overridden with --agent) --pathname=<pathname> Specify the pathname to which the file is saved. --primary Try to fetch from the IERS URL before the cache URL --retry=<N> Upon fetch failure, try again up to N times (default 0). --retry-delay=<N> When --retry is set, sleep N seconds between tries (default 0.5). --show-url Write to STDOUT the URL from which the file was downloaded. (Before pathname is written to STDOUT, on a different line.) -q Do not write pathname to STDOUT or error messages to STDERR.
At the time of this writing, tai-download-leapseconds first tries to download the leapseconds list from the module author's own server, which under normal circumstances should fail (with an HTTP 404 reply code). When it is unable to retrieve the list from this location, it will attempt to download the list from the IETF's server at https://www.ietf.org/timezones/data/leap-seconds.list.
404
The reason for doing it this way is to allow workarounds should the IETF suffer infrastructure failure. If the IETF changes the location of their official list without setting up a redirect, or if their servers go down for an extended period of time, the module author can set up an HTTP 302 redirect to the new official leapsecond location, or provide a copy of the file directly.
302
Administrators who do not feel comfortable depending on some random guy's server should maintain their own redirect or leapsecond list file for their organization and pass the URL of this resource to tai-download-leapseconds as an argument, or just maintain each server's /etc/leap-seconds.list themselves and not use tai-download-leapseconds at all.
/etc/leap-seconds.list
TTK Ciar, <ttk[at]ciar[dot]org>
Copyright 2014-2015 by TTK Ciar
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Time::TAI::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::TAI::Simple
CPAN shell
perl -MCPAN -e shell install Time::TAI::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.