Штатный скрипт (в том числе присутствует в справке)
"Create a Shell Script to Initiate the Backups"
. Save your changes.
Create a Shell Script to Initiate the Backups
=============================================
It is also important that the second-stage backup of the NetBackup
catalogs occurs directly after the first-stage backup. A good way to
ensure this is to write a script that initiates both backups, one after
the other. The following is an example catalog-backup script:
#!/bin/sh
#
# catalog_backup script
#
# Performs a two-stage backup of the NetBackup catalogs
#
CLASS=nbu_cat_backup # Change to the name of the correct class
SCHED=full_backup # Change to the name of the correct schedule
LOGDIR=/usr/openv/netbackup/logs/catalog_backup
if [ -d $LOGDIR ]; then
exec >> $LOGDIR/log.`date “+%m%d%y”` 2>&1
else
exec > /dev/null 2>&1
fi
echo “Running first stage catalog backup”
/usr/openv/netbackup/bin/bpbackup –w –i –c $CLASS –s $SCHED
EXIT_STAT=$?
if [ $EXIT_STAT –ne 0 ]; then
echo “First stage catalog backup failed ($EXIT_STAT)”
exit 1;
fi
echo “Running second stage catalog backup”
/usr/openv/netbackup/bin/admincmd/bpbackupdb
EXIT_STAT=$?
if [ $EXIT_STAT –ne 0 ]; then
echo “Second stage catalog backup failed ($EXIT_STAT)”
exit 1;
fi
exit 0;
## end of script