Forum Discussion

Steven05's avatar
Steven05
Level 4
10 years ago
Solved

Netbackup daily report

Hello
I'm not very good at scripting (shell: bash or ksh).
I solice your help to a daily report of the backup environment.

a report listing all servers backed up by success and failure with its own police the error code in the last 24 hours and the other ... I would launch this script every day of the week.

Thank you

  • Hello Steven05,

    cd /usr/openv/netbackup/bin/admincmd/bperror -backstat -U -by_statcode -hoursago 24

    should be sufficiant to run on a daily basis.

    bperror.PNG

    Best regards,

    Cruisen

     

4 Replies

  • I have moved this post to the NetBackup forum for better visibility.
  • Check this out:

    # $Header: mail_bp_reports.sh,v 1.2 97/09/18 10:32:30 twz Exp $
    #
    #bcpyrght
    #***************************************************************************
    #* Copyright 1993 - 1998 VERITAS Software Corporation, All Rights Reserved *
    #***************************************************************************
    #ecpyrght
    #
    # mail_bp_reports
    #
    # This script can be used by an adminstrator as a convenient way to mail
    # the various NetBackup reports.  It may be used in a crontab entry to
    # have status mailed to you once per day.
    #
    # some caveats:
    #   -assumes binaries, scripts are located in the right places
    #       bperror
    #       cleanstats
    #       mail
    #   -not tried on all servers, some platforms may need slight modifications
    #

    # This is the command used to get the backup status and problem reports.
    # PATH TO NB COMMANDS
    BPERROR=/usr/openv/netbackup/bin/admincmd/bperror
    BPREPORT=/usr/openv/netbackup/bin/admincmd/bpdbjobs
    BPIMAGELIST=/usr/openv/netbackup/bin/admincmd/bpimagelist
    BPMEDIALIST=/usr/openv/netbackup/bin/admincmd/bpmedialist
    NBEMMCMD=/usr/openv/netbackup/bin/admincmd/nbemmcmd
     

    I email this to myself every day:

    # cat /var/adm/scripts/daily.rpt.ksh
    #!/usr/bin/ksh
    #
    # get day of the week to determine hours to report
    mydate=`date +%w`
    if [ $mydate == 1 ]
    then
    h=72
    else
    h=24
    fi
    # generate report
    /usr/openv/netbackup/bin/admincmd/bperror -U -backstat -hoursago $h -by_statcode > /usr/openv/tmp/bksum.txt

    echo " " >> /usr/openv/tmp/bksum.txt
    echo " " >> /usr/openv/tmp/bksum.txt
    echo " Email generated by script /var/adm/scripts/daily.rpt.ksh on master "
    echo " " >> /usr/openv/tmp/bksum.txt
    echo " " >> /usr/openv/tmp/bksum.txt
    # mail report
    /usr/bin/mailx -s "Daily Backup Summary for last $h hours " Operations@company.com, NBAdmin@company.com, windows@company.com < /usr/openv/tmp/bksum.txt
     

     

    You could likely look into options for the bperror report, to specify specfic policy type or clients. Planning in naming policies and schedules can allow you to get good grouping.

  • Hello Steven05,

    cd /usr/openv/netbackup/bin/admincmd/bperror -backstat -U -by_statcode -hoursago 24

    should be sufficiant to run on a daily basis.

    bperror.PNG

    Best regards,

    Cruisen