#!/bin/ksh
###############################################################################
# Version 1.0 - released April 12, 2002                                       #
# Script to run Ignite backups to a network Ignite server                     #
# Created by Russ Hunter hunter@javalina.net                                  #
# Released under the GNU General Public License                               #
# See http://www.gnu.org/licenses/gpl.txt or http://www.javalina.net/gpl      #
# for complete license info.                                                  #
#                                                                             #
###############################################################################
# SETUP INSTRUCTIONS                                                          #
# You'll need to set the following variables before using the script:         #
# $COPIES, $IGSERVER, $BNET, $ADMIN                                           #
# Once those are set, you're ready to go.  The script will identify the mac   #
# address and hostname.  Just set up a cron entry to run the script as        #
# needed.  By default, output from the last backup is saved to                #
# /var/adm/syslog/ignite.log, and the logfile is mailed to the administrator. #
# if you prefer not to trim the log file automatically, change the ">" in     #
# the last line to ">>".                                                      #
###############################################################################
#
# $COPIES sets the number of backup copies to keep on the ignite server
COPIES=6
# $BNET is the backup network
BNET=172.16.48.0
# $HOST is the name of the client
HOST=`uname -n`
# $ADMIN is the email address of the administrator
ADMIN=admin@xyz.com
# $INT is the lan interface associated with the backup network
INT=`/usr/bin/netstat -rn |/usr/bin/grep 172.20.12.0 |/usr/bin/cut -c65-68`
# $MAC is the lanic id or mac address
MAC=`/usr/sbin/lanscan |/usr/bin/grep $INT | /usr/bin/cut -c13-26`
#
# Execute the Ignite backup
/opt/ignite/bin/make_net_recovery -s $IGSERVER -d $HOST -l $MAC -n $COPIES -P s -x exclude=/home -v >> /var/adm/syslog/ignite.log
#
# Email the log file to the admin
/usr/bin/cat /var/adm/syslog/ignite.log |/usr/bin/mailx -s "Ignite log for $HOST" $ADMIN
exit 0
