#!/usr/bin/ksh
#
# viocfgbkp - script to backup the VIOS config.
#
# Description
# -----------
# This script will backup VIO server configuration. This backup
# could be used to recover the VIO server configuraton.
# The backup file will be named VIOS.viosbr.backup.Day, where VIOS is
# the hostname of the VIO server, Day is the day of the week.
#
# e.g. /home/padmin/cfgbackups/VIOS1.viosbr.backup.Day
#
# This script runs the viosbr command. The viosbr command performs
# the operations for backing up the virtual and logical
# configuration, listing the configuration, and restoring the
# configuration of the Virtual I/O Server. The viosbr command can be
# run only by the padmin user.


#
# Backup the VIOS configuration.
#
echo "---------------------------------------------------------"
echo "Starting viosbr Backup on $(/usr/ios/cli/ioscli hostname) at $(date)"
echo
echo /usr/ios/cli/ioscli viosbr -backup -file $(/usr/ios/cli/ioscli hostname).viosbr.backup.$(date +%a)
/usr/ios/cli/ioscli viosbr -backup -file $(/usr/ios/cli/ioscli hostname).viosbr.backup.$(date +%a)
if [ $? -ne 0 ]
then
echo
echo "Error in backing up VIOS configuration"
echo
fi
echo
echo "Finished viosbr Backup on $(/usr/ios/cli/ioscli hostname) at $(date)"
echo "---------------------------------------------------------"
