#!/bin/sh
# 
# Copy files from offsite to the local site just in case
# This requires:
#  1. You run this on the local site to which the backups go
#  2. On the remote site, you have your local login info in a 
#     .rhosts file. See man rhosts or man rcp for info.
#  3. Sufficient local disk space to handle this
#
# I run it nightly from cron.
#

# What's the account and site?
mushsite=mush@remote

# At that account, what subdirectory does the MUSH live in?
mushdir=mush

# At the local account, where should backups go?
# Create this directory and subdirectories src and txt
backupdir=/home/me/offsite

# If your dbs are compressed, set ext=.Z or ext=.gz
ext=

# Get the databases
/usr/ucb/rcp $mushsite:$mushdir/game/data/outdb$ext $backupdir
/usr/ucb/rcp $mushsite:$mushdir/game/maildb$ext $backupdir
/usr/ucb/rcp $mushsite:$mushdir/game/chatdb$ext $backupdir

# Get the cnf files and the restart script
/usr/ucb/rcp $mushsite:$mushdir/game/restart $backupdir
/usr/ucb/rcp $mushsite:$mushdir/game/*.cnf $backupdir

# Get the txt files
/usr/ucb/rcp $mushsite:$mushdir/game/txt/*.txt $backupdir/txt

# Get the source code
/usr/ucb/rcp $mushsite:$mushdir/*.h $backupdir/src
/usr/ucb/rcp $mushsite:$mushdir/src/*.c $backupdir/src
/usr/ucb/rcp $mushsite:$mushdir/hdrs/*.h $backupdir/src
