Version 2
Copyright © 2005-2012 Delaware Environmental Observing System
Published: August 16th 2005
Revision History | ||
---|---|---|
Revision 1.1 | 2005/08/16 | GEQ |
Initial version | ||
Revision 1.2 | 2006/08/24 | GEQ |
Added data feeds option. | ||
Revision 2.1 | 2006/09/26 | GEQ |
Incremented version number of this document to 2. | ||
Revision 2.2 | 2006/11/16 | GEQ |
Added the retries command line option. | ||
Revision 2.3 | 2007/05/11 | GEQ |
Revised the data feed generation section. |
Table of Contents
The DEOS cfgen program provides the functionality to generate cache files for the ODD-DIVAS component to speed delivery of data intensive web pages. The program also has the capability to generate RSS version 2.0 and Atom a version 1.0 feed information for all the networks and stations.
The program is executed by the command cfgen from the command line.
cfgen
{ -u username
| --user username
} { -p password
| --password password
} { -d database
| --database database
} { -n network
| --network-name network
} [--current-feeds] [--daily-feeds] [--base-uri text
] [--begin date
] [--end date
] [ -r value
| --retries value
] [ -v value
| --verbose value
] [ -h | --help ]
The cfgen program uses database configuration parameters to determine which data streams require data retrieval, as well as the method needed to retrieve them, and any associated parameters.
The specification for the user option is:
{ -u username
| --user username
| --user=username
}
This option will allow the program to connect to the database using the username provided. The user must already exist, and have sufficient permissions to access the database specified. This item is required.
The specification for the password option is:
{ -p password
| --password password
| --password=password
}
This option in combination with the username allows the program to connect to the database using the username provided. This item is required.
The specification for the database option is:
{ -d database
| --database database
| --database=database
}
This option will specify which database the program should use as a source of data, configuration items and a destination for any event logging items. This item is required.
The specification for the begin option is:
[ --begin time string
| --begin=time string
]
This option specifies a timestamp for data processing to begin. The time string format can be either YYYYMMDDHHMMSS or YYYY-MM-DD HH:MM:SS. If the latter is used, the string must be placed in quotes.
The default is the current time. The time string, if provided, must contain at least the year, month and day of month. If the hours, minutes and seconds entries are missing, the default is midnight.
The specification for the end option is:
[ --end time string
| --end=time string
]
This option specifies a timestamp for data processing to end. The time string format can be YYYYMMDDHHMMSS or YYYY-MM-DD HH:MM:SS. If the latter is used, the string must be placed in quotes.
The default is the time the program is run. The time string, if provided, must contain at least the year, month and day of month. If the hours, minutes and seconds entries are missing, the default is midnight.
The end time must be later, i.e. more recent, than the start time.
The specification for the network name option is:
{ -n network name
| --network-name network name
| --network-name=network name
}
This option specifies the network name and is required.
The specification for the current feeds option is:
[ --current-feeds ]
This option indicates that the user wants to generate RSS version 2.0 and Atom version 1.0 current data feed files.
The specification for the daily feeds option is:
[ --daily-feeds ]
This option indicates that the user wants to generate RSS version 2.0 and Atom version 1.0 daily data feed files. This option also generates the completed monthly summary files.
The specification for the base-uri option is:
[ --base-uri text
| --base-uri=text
]
This option overrides any database setting of this parameter. The value must be the identifier of the odd-divas virtual folder.
The specification for the retries option is:
[ -r value
| --retries value
| --retries=value
]
This option specifies the number of connection retries that the program will attempt. The default is 1.
The specification for the verbose option is:
[ -v value
| --verbose value
]
The value provided for the verbose setting (a digit between 0 and 5) indicates how much output is generated, 0 being minimal and 5 being extremely verbose. Positive values of setting send data to the ELF, negative value also print the message to the screen. If no value is provided, the setting is assumed to be 1.
The following database tables provide configuration options for the cfgen program.
Table 1. cfgen Database Controls
Name | Description |
---|---|
OD_BASE_URI | The base uri for ODD-DIVAS. |
DF_BASE_URI | The base uri for the data feed directory. |
DF_BASE_DIR | The base directory for storing the feed files. |
NUM_FEED_DAYS | The number of daily feed items to included in a daily feed file. |
NUM_FEED_MONTHS | The number of completed month feed items to included in a monthly feed file. |
WEBMASTER_EMAIL | The email address to be used for the webmaster element of the RSS channel element. |
COPYRIGHT | The text to be used in the copyright element in the RSS channel element. The text 'YYYY', if present, will be replaced by the current year automatically. |
AUTHOR_NAME | The text to be used in the name sub-element of the author element in Atom feeds. |
AUTHOR_EMAIL | The text to be used in the email sub-element of the author element in Atom feeds. |
RIGHTS | The text to be used in the rights element of the Atom feed. The text 'YYYY', if present, will be replaced by the current year automatically. |
For operational use, it is expected that the cfgen program be run from inside the cron system. The most appropriate installation would be to run the cfgen an appropriate interval after midnight local time at the station in the westernmost time zone in the network. The appropriate interval would depend on various factors, including anticipated load on the database, the web server and the delay characteristics of the data feed in question. In this mode no begin or end options are needed.
The ODD-DIVAS pages that generate the daily and monthly summaries generate and store significant amounts of intermediate and final data used to generate the pages, the cache generator program allows the offline generation of this intermediate data, as well as where appropriate an HTML cache version of the page once that time period is in the past.