Operating System - HP-UX
1833582 Members
3472 Online
110061 Solutions
New Discussion

Re: Ignite recovery Tape with shell script

 
JUAN_17
Occasional Advisor

Ignite recovery Tape with shell script

Hi everybody!

how i can create an ignite Recovery tape via shell script?
is possible?

thanks from Venezuela!
2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: Ignite recovery Tape with shell script

Absolutely it is possible.

Here is a script we use:

#!/bin/sh

#set -x

# Purpose: This script makes System Recovery Tape.

DATE=`/usr/bin/date '+%m%d%y'`

HOSTNAME=`/usr/bin/hostname`

LOG_DIR=/var/adm/logs/sysrecover

LOG_FILE=${LOG_DIR}/${HOSTNAME}.${DATE}

LVMCONF_DIR=/etc/lvmconf

TAPE=/dev/rmt/0m

NTAPE=${TAPE}n

/usr/bin/mt -f ${TAPE} rewind

/usr/bin/date > ${LOG_FILE}
/usr/bin/echo "" >> ${LOG_FILE}

${LOG_FILE}
/opt/ignite/bin/make_tape_recovery -a ${NTAPE} -I -m tar -t "$(uname -n) system recovery tape created on $(date)" -v -x inc_entire=vg00 >> ${LOG_FILE} 2>&1

/usr/bin/mt -f ${TAPE} offl

/usr/bin/echo "" >> ${LOG_FILE}
/usr/bin/date >> ${LOG_FILE}

/usr/bin/touch ${LOG_DIR}
/usr/bin/find ${LOG_DIR} -depth -mtime +7 -exec /usr/bin/rm -r {} \;

/usr/bin/rm ${LVMCONF_DIR}/*.mapfile

mailx -s "$(uname -n) $(grep -i completed ${LOG_FILE})"

LucianoCarvalho
Respected Contributor

Re: Ignite recovery Tape with shell script

here is another way.

#!/usr/bin/sh
parameter=""
find /dev -name group -type c -print | while read name
do
/usr/sbin/vgdisplay $(dir $name) >/dev/null 2>&1
if [[ $? -eq 0 ]]
then
parameter=$parameter" -x inc_entire="$(basename $(dir $name))
fi
done
make_tape_recovery -a /dev/rmt/1mn $parameter

regards