Automatic Log backup
Posted in 2011
Topics: Logging & Checkpoints
I read that altering the ALARMPROGRAM parameter allows for automatic log backup. I did so but it doesn't look like my logs are being backed up automatically. I modified the alarmprogram.sh and used that in my parameter. Am I missing something?
Depends on what you put into alarmprogram.sh! Can you post the section for trapping event code 23 (log complete)? Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jan 11, 2011 at 5:29 PM, Jeremiah <yogensha.sql@gmail.com> wrote: > I read that altering the ALARMPROGRAM parameter allows for automatic > log backup. I did so but it doesn't look like my logs are being backed > up automatically. > > I modified the alarmprogram.sh and used that in my parameter. > > Am I missing something? > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list >
This is what's in section 23:
# LOGICAL LOG FILE COMPLETED
# onbar assumes no operator is present, so all messages arewritten to the
# activity log and there shouldn't be any output, but send
everything to
# /dev/null just in case
printf "Subject: $INFORMIXSERVER : $EVENT_SEVERITY_NAME :
$EVENT_MSG\\n" >> $MAILHEAD
printf "$EVENT_ADD_TEXT\\n" >> $MAILBODY
# TO IMPLEMENT LATER
# If there is already a logical log backup don't launch onbar again.
if ( `test x${BACKUPLOGS} = xY` ) then
$BACKUP_CMD 2>&1 >> /dev/null
EXIT_STATUS=$?
printf " '$BACKUP_CMD' has been executed and returned CODE=
%s\\n\\n" $EXIT_STATUS >> $MAILBODY
else
echo "Script will not backup the logical logs."
fi
# Now check if the logs are near to fill up
NUMLOGUB=`$ONSTATCMD -l | grep U-B | wc -l`
NUMLOGF=`$ONSTATCMD -l | grep F- | wc -l`
NUMLOGA=`$ONSTATCMD -l | grep A- | wc -l`
NUMLOGU=`$ONSTATCMD -l | grep U- | wc -l`
NUMLOG=`expr $NUMLOGU + $NUMLOGA + $NUMLOGF`
PERC=`expr \\( 100 \\* \\( $NUMLOGUB + $NUMLOGF + $NUMLOGA \\)
\\) / $NUMLOG `
if ( `test $PERC -le 10` ) then
PERC=`expr 100 - $PERC`
printf "\\n-------------------------------------\\n\\n" >>
$MAILBODY
printf "WARNING : MORE THAN 90 PERCENT (%s percent) OF THE
LOGICAL LOGS ARE FULL\\n" $PERC >> $MAILBODY
printf " A LOGICAL LOG BACKUP IS NEEDED. SEE INFO
BELOW\\n" >> $MAILBODY
$ONSTATCMD -l | grep -v Blocked: | grep -v Block: | tail +4
>> $MAILBODY
fi
;;
On Jan 11, 4:52 pm, Art Kagel <art.ka...@gmail.com> wrote:
> Depends on what you put into alarmprogram.sh! Can you post the section for
> trapping event code 23 (log complete)?
>
> Art
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (a...@iiug.org)
> Blog:http://informix-myview.blogspot.com/
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions and
> do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
> organization with which I am associated either explicitly, implicitly, or by
> inference. Neither do those opinions reflect those of other individuals
> affiliated with any entity with which I am affiliated nor those of the
> entities themselves.
>
> On Tue, Jan 11, 2011 at 5:29 PM, Jeremiah <yogensha....@gmail.com> wrote:
> > I read that altering the ALARMPROGRAM parameter allows for automatic
> > log backup. I did so but it doesn't look like my logs are being backed
> > up automatically.
>
> > I modified the alarmprogram.sh and used that in my parameter.
>
> > Am I missing something?
> > _______________________________________________
> > Informix-list mailing list
> > Informix-l...@iiug.org
> >http://www.iiug.org/mailman/listinfo/informix-list
I think I found my problem. ALARMPROGRAM parameter was pointing to the wrong path.