Re: Tb(On)Tape to Disk for Backups?
Posted in 1995
Melvin Mariney (melvin.mariney2@bridge.bst.bls.com) wrote:
: Fellow Informixer's,
: Is it possible to use tbtape or ontape to do a backup to a disk file
: rather than a tape file. In reading the documentation and actually
: changing the TAPEDEV parameter to a disk file and trying to do
: a level 0 backup, it failed with 'unable to write to archive tape'
: message. Just would like to know if anyone else has tried this and got
: different results.
tbtape can write to something other than a tape-device, the only
requirements are that the file exist, and be readable/writable by user
"informix". If you were to try and do something in a shell program,
it might look something like this:
------------------------------------------------------------------------------
#!/bin/sh
# This is off the top of my head, so it's not guarnteed to work
# without some additional tinkering.
#Substitute your directory as appropriate
INFORMIXDIR=/usr/informixexport INFORMIXDIR
SQLEXEC=${INFORMIXDIR}/lib/sqlturbo
export SQLEXEC
# Substitute the name of your tbconfig file as appropriate.
TBCONFIG=tbconfig
export TBCONFIG
PATH=${PATH}:${INFORMIXDIR}/binexport PATH
# Substitute the name of the file you really want to use
# The filename must also match in the TAPEDEV parameter
# within the tbconfig file
FILE=/tmp/online_archive
ID=`whoami`
if [ $ID != "informix" ]
then
echo "This program needs to be run as user informix. Aborting."
exit 1
fi
# Check to see if the archive file is already out there, and
# if so, move it out of the way.
if [ -r $FILE ]
then
mv ${FILE}.old
fi
# Initiate the archive file before calling tbtape
touch $FILE
chown informix $FILE
chgrp informix $FILE
chmod ug=rw,o-rwx $FILE
# tbtape is being called with a "here" document to get around the
# normal interactive nature of the program.
tbtape -s << EOF
0
EOF
--
+--------------------+----------------------------+--------------------------+
| Michael Faurot | mfaurot@phzzzt.atww.org | I don't like |
| ------- ------ | | lima beans!! |
+--------------------+----------------------------+--------------------------+