#!/bin/sh

# this script should be run nightly to extract the data found in the rocat
# database.  It will write a file with the day at the end of it:
# rocat.02 or rocat.22
# This should allow a restore of the data up to one month old, without
# requiring much SysOp intervention.
# To destroy your database and restore:
# 1. msqladmin drop rocat 
# 2. msqladmin create rocat
# 3. msql < backup_database_file
#
# Of course, you'll want to run this on the machine with the database.
# 

if [ ! -d $BBSDIR ]; then
	echo $BBSDIR not set.  Please set and re-run.
	exit 1
fi

OUTPUT=rocat.`date +%d`

$BBSDIR/msql/bin/msqldump rocat > $BBSDIR/backup/$OUTPUT

