[tz] FW: Beginner's help request

Daniel Ford dfnojunk at gmail.com
Thu Nov 23 13:10:52 UTC 2017


Thanks Paul and Zefram (and Brian via PM).  I really do appreciate all the
time you're spending on educating me about the TZdb and its use.  I'm almost
reaching the state of 'data overload'! :-)

I have now contacted my website hosting service to ask them about what I can
and cannot do on their server, and the brief answer was (a) CAN: "create a
shell script to manipulate the data and create new files under your hosting
service on the server", and (b) CANNOT: "its possible to run .exe on the
Linux server but some additional package installation needed.  However, we
can't install this package on the server as your website is hosted in the
shared server environment."

So that rules out running zic, zdump and any such programs.  All I can do is
run shell commands.  Fortunately the typical Linux shell seems to be pretty
competent, including wget, unzip/untar commands, and this might be enough to
have my TZdb mirror running autonomously without me having to do anything
(after setting it up with a script, of course).

So what I envisage my server doing, perhaps weekly (using Cronjob), is:
1. Check if tzdata-latest.tar.gz has changed, and download it if so;
2. If a new version was downloaded, unpack it to the individual files into
my TZdb web page directory;
3. Copy the rule files to a single file: 'cp africa antarctica asia
australasia europe northamerica southamerica zoneData.txt'
(Yes, I understand that's not the full set of data files, but it is the
subset that I need for my purpose, as Zefram inferred.)

So now comes my next beginner's question (not being a Linux user),
concerning steps 1 and 2 above.  Looking through the wget manual, this
method appears to show promise (thanks to Brian for this suggestions):
  wget -N ftp://ftp.iana.org/tz/tzdata-latest.tar.gz

But what is not clear in the manual is how I check if a newer file has been
downloaded.  They talk about the error codes returned by wget, but without
explaining explicitly what is returned when wget (a) finds the files the
same and doesn't download anything, or (b) finds a newer version and
downloads it.
If these situations produce different error codes, I can use an 'if'
statement in my script to process the new data iff a new file arrives.

Not wanting to load too many questions into one mail (nor overload my addled
brain!), I'll leave till later a summary of how I propose to handle the
clock-end firmware interaction with my 'TZdb server'.

Regards,
Daniel



More information about the tz mailing list