background image
<< Manually edit the file | RVM Configuration Samples >>
<< Manually edit the file | RVM Configuration Samples >>

Cleaning up temp files

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The
sun_erm_setup.ksh
Script
Remote Mirroring of an Oracle Database Using Data Replicator Software
C-49
chmod 600 $RMT_SCRIPT_DIR/erm.conf >> sun_erm_setup.trace 2>&1
STATUS=$((STATUS+$?))
if [[ $PWD != $RMT_SCRIPT_DIR ]]; then
cp $PWD/sun_erm_setup.ksh $RMT_SCRIPT_DIR/. >>
sun_erm_setup.trace 2>&1
STATUS=$((STATUS+$?))
cp $PWD/sun_erm.ksh $RMT_SCRIPT_DIR/. >>
sun_erm_setup.trace 2>&1
STATUS=$((STATUS+$?))
cp -r $PWD/.remote $RMT_SCRIPT_DIR >> sun_erm_setup.trace
2>&1
STATUS=$((STATUS+$?))
cp -r $PWD/.primary $RMT_SCRIPT_DIR >> sun_erm_setup.trace
2>&1
STATUS=$((STATUS+$?))
cp -r $PWD/goodies $RMT_SCRIPT_DIR >> sun_erm_setup.trace
2>&1
STATUS=$((STATUS+$?))
fi
rcp $PWD/.primary/$DB_TYPE/* $PRI_HOST:$PRI_SCRIPT_DIR >>
sun_erm_setup.trace 2>&1
STATUS=$((STATUS+$?))
echo "DONE! STATUS=$STATUS"
# Yeah, I'm being lazy here...
if (( STATUS > 0 ))
then
echo "\n${B1}ERROR!${EB}\c"
echo "\tUnable to write all of the files, please review"
echo "the $PWD/sun_erm_setup.trace file.\n"
exit 4
else
echo "\nPlease wait, cleaning up temp files...\c"
rm ${TMP_FILE[0]} > /dev/null 2>&1
rm ${TMP_FILE[1]} > /dev/null 2>&1
rm ${TMP_FILE[2]} > /dev/null 2>&1
rm ${TMP_FILE[3]} > /dev/null 2>&1
rm sun_erm_setup.trace > /dev/null 2>&1
fi
echo "\n\nTo execute the main script, issue the following from
the $PRI_SCRIPT_DIR."
echo "\nsun_erm.ksh [-c <config file name>] [-d] [-v]"
echo "\nWhere -c <config file name> specifies an alternate
configuration file to use"
echo " in place of the default of 'erm.conf'. Useful for
control of"
echo " multiple system backups."