How To Do a Hot Backup for iSeries

How To Do a Hot Backup for iSeries

Below is the shipped backup.sh script. This script can be executed from an iSeries QSH command line, CL script or within the Business Process Script.
By default the backup directory is EBI_HOME/database/backup.
If users want to change the script, it is recommended that they copy the shipped copy. One update would be the target directory, then update the DB_FOLDER_BACKUP variable.
To run the command: Execute backup.sh -online or backup.sh -offline

BACKUP.SH script by EXTOL


#
# This Bash script performs an "on-line" backup of EBI's
# internal storage data.
#
##################################################################

# This script should be within ${EBI_INSTALL_DIR}/utils
# Path construction is relative to this scripts location.
#
if [ -z $1 ]
then
echo usage: backup.sh [-online -offline]
exit 1
elif [ $1 != "-online" -a $1 != "-offline" ]
then
echo usage: backup.sh [-online -offline]
exit 1
fi

EBI_HOME=..

echo EBI archive procedure started at $(date)

DB_FOLDER=$EBI_HOME/database
DB_FOLDER_BACKUP=$DB_FOLDER/backup

DB_FOLDER_UTIL=$DB_FOLDER/utils

#Backup the database.
cd $DB_FOLDER_UTIL
./backup_db.sh $1
cd ../../utils

#Create file extension.
NOW=$(date +"%m_%d_%[email protected]%T")

BACKUP_FOLDER=../backups

#make the directory, -p makes it ignore the error if it already exists
mkdir -p $BACKUP_FOLDER

#Combine them into a single archive:
COMBINED_ARCHIVE_FILE=$BACKUP_FOLDER/ebi_archive_$NOW.tar

#folders:
DB_BACKUP_FOLDER=$DB_FOLDER_BACKUP/xdb1
SM_FOLDER=$EBI_HOME/ebi
LOG_FOLDER=$EBI_HOME/resources/data/logging

#Archive the DB backup:
echo Archiving $DB_BACKUP_FOLDER, $SM_FOLDER, $LOG_FOLDER to $COMBINED_ARCHIVE_FILE
tar --force-local -cf $COMBINED_ARCHIVE_FILE $DB_BACKUP_FOLDER $SM_FOLDER $LOG_FOLDER

echo Zipping archive $COMBINED_FILE
gzip -S .gz $COMBINED_ARCHIVE_FILE

echo EBI archive procedure completed at $(date)


By: on
A free web counter provided by GoStats.