ANSWER: pre- and post-dump script?
2003-09-18 09:55:23
So I asked about pre and post-dump scripts several weeks ago. Here
is what I've ended up doing; it seems to be working, and amverify is
happy:
1. compile amanda with tar=/usr/local/bin/tar
2. copy or symlink tar to /usr/local/bin/realtar
3. create a script /usr/local/bin/tar
4. chmod 755 /usr/local/bin/tar
/usr/local/bin/tar contains:
#!/bin/sh
RealCMD=/usr/local/bin/realtar # or whatever it is
DB_DLE=/ # or whatever
EstOrDmp=estimate # a flag, values are estimate or dump
IsDB_DLE=no # a flag, values are yes and no
case "$5" in
$DB_DLE) IsDB_DLE=yes ;;
*) IsDB_DLE=no ;;
esac
case "$3" in
/dev/null) EstOrDmp=estimate ;;
-) EstOrDmp=dump ;;
*) : # unexpected, some error ;;
esac
echo `date` >> /tmp/amanda/tarlog
echo ${@} >> /tmp/amanda/tarlog
echo $3 >> /tmp/amanda/tarlog
echo $5 >> /tmp/amanda/tarlog
echo ${IsDB_DLE} >> /tmp/amanda/tarlog
echo ${EstOrDmp} >> /tmp/amanda/tarlog
if [ ${IsDB_DLE} = yes -a ${EstOrDmp} = dump ];
then
#: #shutdown database (':' is a NoOp placeholder)
# PROFIT$ Database Server Shutdown
# *MUST* not allow any output from database shutdown
#otherwise tar breaks
/u/profits/profits_stop >/dev/null 2>1
fi
${RealCMD} "${@}" # this just runs the real gtar
RtrnCode=$? # with all the original args
if [ ${IsDB_DLE} = yes -a ${EstOrDmp} = dump ];
then
#: #restart database
# PROFIT$ Database Server Startup
# *MUST* not allow any output from database startup
#otherwise tar breaks
/u/profits/profits_start >/dev/null 2>1
fi
exit ${RtrnCode}
--
Kurt Yoder
Sport & Health network administrator
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- ANSWER: pre- and post-dump script?,
Kurt Yoder <=
|
|
|