#!/bin/sh
#
# DB Maintenance for the AutoSys Databases
#

# @(#) $Header:   /fac/dev/3.3/share/bin/VCS/DBMaint.__v   1.3.1.1   Mon May 06 16:28:22 1996   john  $

#set -x

line="
------------------------------------------------------------------------
"
outfile=$AUTOUSER/out/DBMaint.out

MYNAME=`basename $0`
	
echo "$line
$MYNAME: Starting at `date`
$line" >> $outfile

# Archive the Events
archive_events -A -n 7  >> $outfile 2>&1

# Archive the job_runs
archive_events -A -j 7  >> $outfile 2>&1

# Archive the autotrack log
archive_events -A -l 7  >> $outfile 2>&1

echo "$line `date`
">> $outfile

dbstatistics >> $outfile 2>&1

echo "$line
$MYNAME: Finished at: `date` $line" >> $outfile

exit 0
