Kbase 19127: How to Use Probkup Within a UNIX Script.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  21/08/2003 |
|
Status: Unverified
FACT(s) (Environment):
How to use probkup within a UNIX script.
FIX:
#Progress Backup Procedure
#V.1.6 dal Jun 1998
#V.2.0 dal 1999 September
clear
tput cup 6 30
tput smso
echo "START BACKUP PROCEDURE"
sleep 2
tput rmso
clear
# Test database ( off or in use )
proutil dan2 -C busy
if [ $? != 0 ]
then
echo
echo " Do you want to use 'proshut' to force users off \
the system?"
read ans
if [ "$ans" = y ]
then
# You can use the 'system messages' to advertise customer. If you work
# in shared Memory you can send a message directly via UNIX: vtmsg
# or similar script. If you use NFS you can use the possibility of
# this protocol to send messages, or others tools like Netcom, etc"
echo "All usesr are disconnected in 20 seconds"
echo "Please exit database"
sleep 20
proshut -by dan2
else
echo "Backup will not be performed."
exit
fi
fi
echo "Beginning backup."
# Start PROBKUP procedure for a multi volume database"
clear
echo "Coping database with a PROBKUP procedure..."
echo " "
probkup dan2 /usr1/tse/dal/DAN/BACKUP
sleep 4
# Here you can use cpio or tar to save all files related to the DB
# include AI, .st, .lg, etc.
clear
echo "Save all datafiles with cpio procedure...."
echo " "
date
echo "Put the backup date"
echo 'DATE: \c'
read var
# The tree of DB volumes start in /usr1/tse/dal/DAN
# After you have ./DAN/vol1, ./DAN/vol2, ./DAN/vol3, ./DAN/vol4, etc.
# I start my find with -name "d*" because all files of my database are
# named dan2.db, dan2.ai, dan2.bi, dan2.st, dan2.lg, etc.
mv /usr1/tse/dal/DAN/BACKUP/dan2 /usr1/tse/dal/DAN/BACKUP/$var.db
find /usr1/tse/dal/DAN -name "d*" -print |cpio -ocv > /usr1/tse/dal/DA
N/BACKUP/$var
# Test to see if cpio procedure is OK
err=$?
if [ $err != 0 ]
then
echo " failed ....with $err "
else
echo "cpio procedure is OK"
fi
sleep 4
clear
echo "Compress files please wait..."
compress -f /usr1/tse/dal/DAN/BACKUP/$var
compress -f /usr1/tse/dal/DAN/BACKUP/$var.db
clear
echo "Display backup files"
cd /usr1/tse/dal/DAN/BACKUP
ls -lp $var* > delete
#awkprocedure: { printf "%10s %10s %10s %10s %-10s\n", $5,$6,$7,$8,$9
}
awk -f awkprocedure delete
sleep 4
rm delete
tput smso
echo "BACKUP PROCEDURE END"
tput rmso
This is a full backup procedure(alive), this procedure must be started
by the administrator, but it can be modified and put into a crontab to
start a batch process.
To test this, create a .st like:
dal:chablis$ cat dan2.st
d /usr1/tse/dal/DAN/vol1/dan2.d1 f 96
d /usr1/tse/dal/DAN/vol3/dan2.d2 f 96
d /usr1/tse/dal/DAN/vol5/dan2.d3 f 96
b /usr1/tse/dal/DAN/vol2/dan2.b1
a /usr1/tse/dal/DAN/vol4/dan2.a1 f 1024
a /usr1/tse/dal/DAN/vol4/dan2.a2 f 1024
for example.
owner: your login (or root )
group: your group ( or sys )
chmod: 700 minim. -rwx --- ---