Dayfile.txt: Difference between revisions

1,028 bytes added ,  08:29, 22 May 2020
m
no edit summary
mNo edit summary
Line 1: Line 1:
= Introduction =
= Introduction =
Cumulus maintains a daily log file that holds the highs and lows of each day, as well as a few other nuggets of information.  The figures contained in the file are used for the 'This period' display accessed from the '''View''' menu and to build any graphs based on daily values.


The format of this file is the same for both Cumulus 1 and Cumulus MX. It can be ported between them only if both run with exactly the same locale settings, as using a different locale may change the field separator or the symbol used for decimal points.
Cumulus maintains a daily log file that holds the highs and lows of each day, as well as a few other nuggets of information. In all flavours of Cumulus, this file is only updated (with exclusive lock) during the end of meteorological day process. In that process it is also read if the generation of NOAA reports has been requested.
 
In Cumulus 1 only, the figures contained in the file are used for the 'This period' display accessed from the '''View''' menu and to build any graphs based on daily values.
 
The format of this file is the same for both Cumulus 1 and Cumulus MX, although the number of fields in the file increases in various versions as shown at the end of this article. The file can be ported between flavours only if both are run with exactly the same locale settings, as using a different locale may change the field separator or the symbol used for decimal points.
{{TOCright}}


== When Cumulus is left running ==
== When Cumulus is left running ==
* Cumulus is frequently reading observations from your weather station, but these don't affect the daily log "dayfile.txt" as it is only updated once a day.
* Cumulus is frequently reading observations from your weather station, but these don't affect the daily log "dayfile.txt" as it is only updated once a day.
* There are no updates to dayfile.txt at any other times, but the contents of the file are read and processed for many of the display and edit menu options when selected from the main Cumulus 1 screen.
* There are no updates to dayfile.txt at any other times, but (for Cumulus 1 only) the contents of the file are read and processed for many of the display and edit menu options that can be selected from the main Cumulus 1 screen.
* Cumulus tracks the highs and lows in weather observations by comparing read values against those it has stored in [[Today.ini]], updating that file as required. (It also updates [[Alltime.ini]], [[Monthlyalltime.ini]], [[Year.ini]], and [[Month.ini]] when appropriate.
* Cumulus tracks the highs and lows in weather observations by comparing read values against those it has stored in [[Today.ini]], updating that file as required. (It also updates [[Alltime.ini]], [[Monthlyalltime.ini]], [[Year.ini]], and [[Month.ini]] when appropriate.
* Cumulus will not mind you accessing the daily log outside its software, except when it needs write access for processing end of day.  
* Cumulus will not mind you accessing the daily log outside its software, except when it needs write access for processing end of day.  
Line 12: Line 17:


=== When Cumulus processes the end of the (meteorological) day ===
=== When Cumulus processes the end of the (meteorological) day ===
*It updates the daily log, the highs, lows and other information in 'today.ini' are used to append a new line into dayfile.txt, and some of this information is also stored in [[yesterday.ini]].
*Back ups of all the log files mentioned here (not all the log files) are copied to the 'cumulus\backup\daily' folder, a total of 9 sub-folders are retained.
*A new row is appended to dayfile.txt, the values are prepared from reading "today.ini" file, not all values available in "today.ini" are stored in dayfile.txt.
* Some people take a copy of the local file, after it has been updated and store it on (or file transfer it to) their web server. One way of doing this is [[Upload_Dayfile| described here]].
*Some of this information is also stored in [[yesterday.ini]].
*Back ups of both today.ini, and dayfile.txt, log files ''in their state after the end of day update'' are copied to the 'cumulus\backup\daily' folder, a maximum of only 9 daily sub-folders are retained.
 
'''Optional'''
* Some people require a copy of the local file to use on their web server. Consequently, after it has been updated they file transfer it to (or if their web server is local, copy it to) their web server. One way of doing this is [[Upload_Dayfile| described here]].
*Some people take a copy of the local file, and use it locally for other purposes. See [[#How you can use the daily log|How you can use the daily log section]] and also the [[[[User Contributions|Cumulusutils]]]] link.
*For Cumulus [[File:Badge vMx.png]] there is an option of converting the file into a database table, and that table having a new row added each time the file gains a new line as described [[Cumulus_MX#Optional_Sections|here]].
   
   
=== When Cumulus is restarted after a break in running  ===
=== When Cumulus is restarted after a break in running  ===
* It reads the daily log and uses the rainfall totals for each day stored in the daily summary log to calculate the rainfall for this month, and this year/season (see [[FAQ#Where_does_Cumulus_get_its_this_month_and_this_year_rainfall_totals_from.3F|FAQ]])
* It reads the daily log and uses the rainfall totals for each day stored in the daily summary log to calculate the rainfall for this month, and this year/season (see [[FAQ#Where_does_Cumulus_get_its_this_month_and_this_year_rainfall_totals_from.3F|FAQ]])
* Thus you must not have another process attempting access to the daily log when Cumulus is re-starting.
* Thus you must not have another process attempting access to the daily log when Cumulus is re-starting.
* Back ups of all the log files mentioned here (not all the log files) including dayfile.txt are copied to the 'cumulus\backup' folder, the last 8 only are retained.
* Back ups of all the log files mentioned here (not all the log files) including dayfile.txt are copied to the 'cumulus\backup' folder, the last 8 start-up folders only are retained.
 
== How you can use the daily log ==
== How you can use the daily log ==
* If you want to run scripts that use the daily log, it is best if you take a copy first, you can ask Cumulus 1 to take a copy after each update by using the '''Daily''' box in the bottom left of the ''Sites/Options'' frame within the ''Internet'' options screen from the '''Configuration''' menu; that will safely take a copy of 'dayfile.txt' after it is updated. This has the advantage it happens even if Cumulus has been stopped and restarted and rollover is happening during catch-up and so not at usual rollover time according to the computer clock.  See Cumulus 1 '''Help''' for information on using this feature, I add a redirection ">daily_batch.log" in the parameter box alongside so that any output from running the command file I specify in the main box is sent to a log file overwritten in each run; this enables me to see the reason for any failure.   
* If you want to run scripts that use the daily log, it is best if you take a copy first, you can ask Cumulus 1 to take a copy after each update by using the '''Daily''' box in the bottom left of the ''Sites/Options'' frame within the ''Internet'' options screen from the '''Configuration''' menu; that will safely take a copy of 'dayfile.txt' after it is updated. This has the advantage it happens even if Cumulus has been stopped and restarted and rollover is happening during catch-up and so not at usual rollover time according to the computer clock.  See Cumulus 1 '''Help''' for information on using this feature, I add a redirection ">daily_batch.log" in the parameter box alongside so that any output from running the command file I specify in the main box is sent to a log file overwritten in each run; this enables me to see the reason for any failure.   
* Cumulus MX has option to list files to be transferred once a day as part of rollover, so you can use that to generate your extra copy. This has the advantage it happens even if Cumulus has been stopped and restarted and rollover is happening during catch-up.  
* Cumulus MX has option to list files to be transferred once a day as part of rollover, so you can use that to generate your extra copy. This has the advantage it happens even if Cumulus has been stopped and restarted and rollover is happening during catch-up.  
5,838

edits