You can also do that with rsync. Here’s my script: rsync --links rsync://rsync.iana.org/tz/tzdata-latest.tar.gz /tmp/tzdata-latest.tar.gz rsync --links rsync://rsync.iana.org/tz/`readlink /tmp/tzdata-latest.tar.gz` ./ rsync --links rsync://rsync.iana.org/tz/tzcode-latest.tar.gz /tmp/tzcode-latest.tar.gz rsync --links rsync://rsync.iana.org/tz/`readlink /tmp/tzcode-latest.tar.gz` ./ Debbie
On Oct 24, 2017, at 4:12 PM, Brian Inglis <Brian.Inglis@SystematicSW.ab.ca> wrote:
On 2017-10-24 16:26, Zefram wrote:
Paul Eggert wrote:
I no longer recommend FTP to get tzdb.
HTTPS is fine for retrieving a specific release, but FTP offers a couple of other facilities that AFAICS HTTPS doesn't provide. Specifically, by FTP I can enumerate old releases (NLST on the /tz/releases directory), and I can identify the latest release (by processing the directory listing). I've automated those jobs. Is there a recommended way to do these things through the HTTPS interface? (Scraping a human-oriented web page isn't an attractive approach.)
I've used the FTP site to date because I can download the -latest symlinks as files using wget -N to a cache directory, so it only checks the mod date if unchanged, then run readlink on the symlink files to get the actual version filenames, and quit if those are the same as the last downloaded.
If the HTTPS repository/releases/ were browsable and/or had public static -latest URIs provided by either server or HTML redirection, I could do similar using curl sans -L to get the latest version URIs, compare those to the last downloaded, and quit if unchanged.
I do prefer HTTPS where available, preferably also backed up by directories with decent sha###sums, and/or gpg/pgp .sigs, and/or .ascs, for downloaded file validation, in case of server, storage, or site problems.
-- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada