British Cave Monitoring Centre (Home)
Freshen the Data
This is an outline page - still to be formatted and expanded
View Uploaded Files & Technical:
View Logs.
The logger data is uploaded automatically, on a scheule (details below). You can trigger a
manual upload by clicking one of the buttons below.
Note: 15-Jun-2024 – Due to a slow broadband
link, the uploads from Pooles cavern are taking a long time, and the BCRA server is timing out and
not transferring all of the files. This is most likely an electrical fault on the phone line
somewhere between Pooles Cavern and the BT cabinet. Some work-arounds have been implemented, as
described below.
- Both php and curl have had large limits placed on their execution time. In
freshen.php I have set $time_limit = 5000; and in the cron job I have set
--max-time 5000 ; 5000s being about 83 minutes.
- The code in freshen.php has been altered so that only a quarter of the files are
handled in any one operation. The cron job now executes every six hours, at 1,7,13 and 19
GMT and each execution handles a different set of files. Additionally, the freshen_log file
is now a set of four files; and the system error output goes to a second set of log files.
Because the code was written in a hurry, and because debugging it was difficult, it uses
what might be considered a rather convoluted procedure, as follows...
- There are four cron entries. All are identical apart from the setting of a
variable myChunk. That variable dictates the name of the log files as
freshen_log_${myChunk}.html and freshen_log_${myChunk}_ERR.txp, but the variable is
not passed to the php program.
- The php program selects a quarter of the files to process. The decision is based
on the time the program is executed. It looks at the hour modulo 4, and
compares it with the file name index, modulo 4, and if they match it processes the file.
This page, http://bcra.org.uk/data/freshen.html was last modified on Sun, 16 Jun 2024 11:24:11 +0100
Server: britiac4.british-caving.org.uk (31.25.186.126)