How to output result of last job - Veritas Net Backup

This is a discussion on How to output result of last job - Veritas Net Backup ; I am trying to create a daily log which displays the results of the jobs run that day (and only that day). Currently my plan is to use bp_exit_notify to run bpdbjobs. However I want to past the job id ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to output result of last job

  1. How to output result of last job


    I am trying to create a daily log which displays the results of the jobs run
    that day (and only that day).
    Currently my plan is to use bp_exit_notify to run bpdbjobs. However I want
    to past the job id to bpdbjobs so I get the result of the last job (the one
    that called bp_exit_notify).
    I have tried using the jobid file, but when I have multiple jobs kicked off,
    there is no good way to know which one finishes first.
    Has anyonedone something similar?

  2. Re: How to output result of last job


    "Matt Shenk" wrote:
    >
    >I am trying to create a daily log which displays the results of the jobs

    run
    >that day (and only that day).
    >Currently my plan is to use bp_exit_notify to run bpdbjobs. However I want
    >to past the job id to bpdbjobs so I get the result of the last job (the

    one
    >that called bp_exit_notify).
    >I have tried using the jobid file, but when I have multiple jobs kicked

    off,
    >there is no good way to know which one finishes first.
    >Has anyonedone something similar?


    #CRON entry
    #00 08 * * * /usr/openv/netbackup/backstat > /dev/null 2>&1
    ###cut here####
    #!/usr/bin/ksh

    #This script is used for giving daily statistics.The cronjob is set to run
    on a daily basis.
    #Script created by JDunn5
    #set -vx
    #Set variables

    TODAY=`date +%a`
    HOST=`hostname`
    CURRDATE=`date +%m%d%y`
    OUTFILE=/var/tmp/out2
    OUTFILE1=/var/tmp/out1
    OUTFILE2=/var/tmp/out2
    OUTFILE3=/var/tmp/out3
    ADMINCMD=/usr/openv/netbackup/bin/admincmd
    BPIMAGELIST=/usr/openv/netbackup/bin/admincmd/bpimagelist
    ERRORLIST=/usr/openv/netbackup/bin/admincmd/bperror
    GOODIE=/usr/openv/netbackup/bin/goodies

    # Clear /tmp/out2 file first
    /bin/rm -rf $OUTFILE $OUTFILE1 $OUTFILE2 $OUTFILE3

    if [ -f /usr/openv/netbackup/version ] ; then
    HARDWARE=`head -1 /usr/openv/netbackup/version | cut -f2 -d" "`
    else
    echo "/usr/openv/netbackup/version not found"
    exit 1
    fi

    for i in $HOST
    do


    $ADMINCMD/bperror -U -backstat -s info -hoursago 24 1>> $OUTFILE 2>&1
    echo " Recently Used Media: " >> $OUTFILE
    $BPIMAGELIST -A -media -hoursago 24 1>>$OUTFILE 2>&1

    $ADMINCMD/bperror -U -backstat -by_statcode >> $OUTFILE2
    mailx -s "Company's Backup by CODE for `date +%x`" net_backup < $OUTFILE2

    $ADMINCMD/bpcatlist -server $HOST -client $CLIENT -since-days 1 >>$OUTFILE3
    mailx -s "NT or UNIX BACKUP FOR $CLIENT BLA BLA for `date +%x`" < $OUTFILE3


    done





+ Reply to Thread