Re: Automatic Backups
Posted in 1996
Hadley (thadley@chiron) wrote:
: Does anybody know how to perform a complete backup from the shell prompt.
: I want to do automatic backups and I don't know how to force the return
: after the prompt for the insertion of the backup tape.
:
: Any help would be greatly appreciated. Thanks.
Here is our script that we use. Hope it helps:
# This script is to backup the entire informix database system
# It is intended for use from crontab
# It should only be used if the entire backup will fit on a single tape
INFORMIXDIR=/home/informix
INFORMIXSERVER=asl7
export INFORMIXDIR INFORMIXSERVERmt -f /dev/rmt/0 status
if [ $? -ne 0 ]
then
echo "No Tape in tape unit!"
exit 1
fi
sleep 30
if /local/bin/newer /admin/.lastlogin /admin/.lastbu
then
echo `date`
$INFORMIXDIR/bin/ontape -s -L 0 <<-EOI
EOI
echo `date`
touch /admin/.lastbu
else
mail sysadm <<-EOM
No Backup Performed!
No sysadm login since last backup - assuming tape not changed.
EOM
fi
mt -f /dev/rmt/0 unload
--
"A computer lets you make more mistakes faster than any invention
in human history with the possible exceptions of handguns and tequila ."
Brian P. Hampson ASL Analytical Service Laboratories Ltd
System Administrator, Vancouver, BC (604)253-4188
----------------- http://www.asl-labs.bc.ca/ ----------------------------