#!/bin/sh  
# \
exec oagtclsh "$0" "$@"
#
# $Log: not supported by cvs2svn $
# Revision 1.1  1996/11/21 15:14:21  borland
# First version of scripts and procedures to manage time-series data logging
# cron jobs.
#
#

set auto_path [linsert $auto_path 0 /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
APSDebugPath
APSStandardSetup
APSDefineMonitoringVariables

set usageMessage "usage: $argv0 -subDirectory <string> -rootname <string> -nextDay 1"

set subDirectory ""
set rootname ""
set nextDay 0
set args $argv
if {[APSStrictParseArguments {subDirectory rootname nextDay}]==-1 || \
      ![string length $subDirectory] || ![string length $rootname]} {
    APSSendDataLoggerErrorEmail -message "Bad commandline arguments: $argv0 $args"
    exit 1
}

APSDefineMonitoringVariables

if [catch {APSStartTimeSeriesLogger -subDirectory $subDirectory \
             -rootname $rootname -nextDay $nextDay} result] {
    APSSendDataLoggerErrorEmail -message "$argv0 $args:  $result"
}
