DEOS Cache and Feed Generation Program Operations Guide

DEOS Technical Note #18

Dr. Geoffrey E. Quelch

Research Fellow,
University of Delaware,
Center for Climatic Research


   University of Delaware
   NewarkDE 19716
   
  

Version 2

All material herein is copyright by the Delaware Environmental Observing System

Published: August 16th 2005

Revision History
Revision 1.12005/08/16GEQ
Initial version
Revision 1.22006/08/24GEQ
Added data feeds option.
Revision 2.12006/09/26GEQ
Incremented version number of this document to 2.
Revision 2.22006/11/16GEQ
Added the retries command line option.
Revision 2.32007/05/11GEQ
Revised the data feed generation section.

Table of Contents

Introduction
Running the Program
Command Line Options
User Option
Password Option
Database Option
Begin Option
End Option
Network Name Option
Current Feeds Option
Daily Feeds Option
Base URI Option
Retries Option
Verbose Option
Help Option
Database Parameters
DEOS_Server_Settings
Networks
Operational Use

Introduction

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.

Running the Program

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 ]

Command Line Options

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.

User Option

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.

Password Option

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.

Database Option

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.

Begin Option

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.

End Option

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.

Network Name Option

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.

Current Feeds Option

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.

Daily Feeds Option

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.

Base URI Option

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.

Retries Option

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.

Verbose Option

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.

Help Option

The specification for the help option is:

[ -h | --help ]

This option prints a summary of all the command line options and exits.

Database Parameters

The following database tables provide configuration options for the cfgen program.

DEOS_Server_Settings

Table 1. cfgen Database Controls

NameDescription
OD_BASE_URIThe base uri for ODD-DIVAS.
DF_BASE_URIThe base uri for the data feed directory.
DF_BASE_DIRThe base directory for storing the feed files.
NUM_FEED_DAYSThe number of daily feed items to included in a daily feed file.
NUM_FEED_MONTHSThe number of completed month feed items to included in a monthly feed file.
WEBMASTER_EMAILThe email address to be used for the webmaster element of the RSS channel element.
COPYRIGHTThe 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_NAMEThe text to be used in the name sub-element of the author element in Atom feeds.
AUTHOR_EMAILThe text to be used in the email sub-element of the author element in Atom feeds.
RIGHTSThe 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.

Networks

The Data_Feed field controls whether the network provides a data feed or not.

Operational Use

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.