NetBackup

Note, my work is based on running Netbackup on Solaris
 * Problems with failed to connect. Had this issue with new client installed and TCP_Wrappers was enabled by default. See HERE to fix.

=Show Jukebox Info=
 * Restoring : How to restore multiple files based on wildcards via the command line
 * 1) vmchange -res -robot_info -verbose -rn 0 -rt TLD -rh

ROBOT INFORMATION for robot 0: Number of Slots = 50 (7 empty) Number of Mailslots = 5 (0 empty) Number of Drives = 2 (2 empty) Robot type and subtype: tld->0 This robot has a barcode reader Starting slot: 1 Ending slot: 50 Primary inquiry string: STKSL5001300.

=Eject tapes= Eject TL8 or TLD volumes (syntax) vmchange -res -multi_eject [-w] [-verbose] -rn  -rt  -rh  -ml  ** NOTE ** There is "gotcha" stuff discussed here and here.

=Inject (load) Multiple Tapes= /usr/openv/volmgr/bin/vmchange -res -multi_inject -w -verbose -rn 0 -rt TLD -rh  -single_cycle

Slot# MediaID Barcode    MAP_Element#  Batch  Status 9 -- A02023                 1      1  Injected. 17 -- A02017                 2      1  Injected. 18 -- A02022                 3      1  Injected. 21 -- A02016                 4      1  Injected. 22 -- A02006                 5      1  Injected.

/usr/openv/volmgr/binvmupdate -rt TLD -rn 0 -rh $MEDIA_HOST
 * NOTE: Be sure to run vmupdate afterwards ***

=Show Job Activity= /opt/openv/netbackup/bin/admincmd/bpdbjobs -report

=Scripts= Networker Commands Manual

Show contents of tape
if [ $# -eq 1 ]; then /usr/sbin/nsr/mminfo -avot -q '!ssrecycle,'volume=$1 else echo "Syntax is $0 " fi
 * 1) !/bin/ksh

Manually recycle Tape
if [ $# -eq 1 ]; then /usr/sbin/nsr/nsrjb -LRYv $1 else echo "Syntax is $0 " fi
 * 1) !/bin/ksh

Eject Multiple Tapes
MEDIA_HOST=backuphost if $ then   echo "enter tape #'s seperated by colons (i.e. A2200:A2201:A2202)" read j       echo "Ejecting Tapes: $j" else   j=$1 fi
 * 1) !/bin/ksh

i=`/usr/bin/echo $j | /usr/bin/tr "[:lower:]" "[:upper:]"`

COMMAND1="/usr/openv/volmgr/bin/vmupdate -rt tld -rn 0 -rh $MEDIA_HOST -vh $MEDIA_HOST \ -use_barcode_rules -empty_map"

COMMAND2="/usr/openv/volmgr/bin/vmchange -res -multi_eject -w -verbose -rn 0 -rt TLD \ -rh $MEDIA_HOST -ml $i -single_cycle"

echo "Updating Tape List" $COMMAND1

echo;echo "Running: $COMMAND2 $COMMAND2

Show Monthly Tapes
SCHEDULE=    #For example,"Monthly_Full"
 * 1) !/bin/sh

echo echo "Month End tapes to pull:" echo "========================"

/usr/openv/netbackup/bin/admincmd/bpimagelist -sl $SCHEDULE -U -media -hoursago 480 2>&1
 * 1) checks 20 days back for any with backup schedule named $SCHEDULE

echo

Eject Monthly Tapes

 * 1) !/bin/ksh

MEDIA_HOST= SCHEDULE=Monthly_Full

AA=`/usr/openv/netbackup/bin/admincmd/bpimagelist -sl $SCHEDULE -l -media -hoursago 480 | awk '{printf"%s:",$1}'` TAPES=${AA%?} COMMAND1="/usr/openv/volmgr/bin/vmupdate -rt tld -rn 0 -rh $MEDIA_HOST -vh $MEDIA_HOST -use_barcode_rules -empty_map" COMMAND2="/usr/openv/volmgr/bin/vmchange -res -multi_eject -w -verbose -rn 0 -rt TLD -rh $MEDIA_HOST -ml $TAPES -single_cycle"

echo;echo "*** Updating Tape List ***"; echo;echo "$COMMAND1" ; echo $COMMAND1 2>&1

echo;echo "*** Ejecting $TAPES ***"; echo;echo "$COMMAND2" ; echo $COMMAND2 2>&1

Show Tapes in Jukebox

 * 1) !/bin/sh


 * 1) Shows tapes in jukebox
 * 2) and how much has been
 * 3) written to them
 * 1) written to them

VMCHECK=/usr/openv/volmgr/bin/vmcheckxxx MEDIA_LIST="/usr/openv/netbackup/bin/admincmd/bpmedialist -mlist -l -ev" AWK=/usr/bin/awk TAIL=/usr/bin/tail ECHO=/usr/bin/echo
 * 1) REMEMBER: Don't assume path variables are set right
 * 1) REMEMBER: Don't assume path variables are set right


 * 1) Lets do it...
 * 1) Lets do it...

printf "%-8s%-7st%sn" 'Slot #' 'Tape #' 'KBs Written' '--' '--' '---' $VMCHECK -rt tld -rn 0 2>/dev/null | $TAIL +6 | $AWK '{print $1,$4}'|

while read slot_no tape_no do amt_written=`$MEDIA_LIST $tape_no 2>/dev/null | $AWK '{print $9}'` printf "%-8s%-7st%+11s %sn" "$slot_no" "$tape_no" "$amt_written" done

Backup Total

 * 1) !/bin/ksh


 * 1) Totals up how much backed
 * 2) up over the last 24 hours
 * 1) up over the last 24 hours

TOT_KB=`/usr/openv/netbackup/bin/admincmd/bperror -all -hoursago 24 | /usr/bin/grep "successfully wrote backup id" | /usr/bin/awk '{bytes += $20} END {printf "%sn",bytes}'`

let TOT_MB=TOT_KB/1000 let TOT_GB=TOT_MB/1000

echo "Total backed up is: $TOT_GB GB  ( $TOT_MB MB / $TOT_KB KB)" | /usr/bin/sed -e :a -e 's/(.*[0-9])([0-9]{3})/1,2/;ta'

Daily Report

 * 1) !/bin/ksh

SED=/usr/bin/sed AWK=/usr/bin/awk GREP=/usr/bin/grep SORT=/usr/bin/sort ECHO=/usr/bin/echo DATE=/usr/bin/date

Total { TOT_KB=`/usr/openv/netbackup/bin/admincmd/bperror -all -hoursago 24 | $GREP "successfully wrote backup id" | $AWK '{bytes += $20} END {printf "%sn",bytes}'` let TOT_MB=TOT_KB/1000 let TOT_GB=TOT_MB/1000 $ECHO "Total backed up is: $TOT_GB GB  ( $TOT_MB MB / $TOT_KB KB)" | $SED -e :a -e 's/(.*[0-9])([0-9]{3})/1,2/;ta' } #- Errors { /usr/openv/netbackup/bin/admincmd/bperror -U -problems -hoursago 24 } #- Written { /usr/openv/netbackup/bin/admincmd/bpimagelist -U -hoursago 24 } #- Written_Contents { /usr/openv/netbackup/bin/admincmd/bpimmedia -U -d `TZ=aaa24 $DATE +%m/%d/%y` } #- Tapes_Used { /usr/openv/netbackup/bin/admincmd/bpimagelist -hoursago 24 -U -media } #-

$ECHO ; $DATE ; $ECHO Tapes_Used Total

$ECHO ; $ECHO "====== Errors ==================================================" Errors

$ECHO ; $ECHO "====== Ammount written per backup policy ========================" Written

Written_Contents
 * 1) $ECHO ; $ECHO "====== Contents of Media Written ==============================="

=User Accounts= Authorized user are defined in /opt/openv/java/auth.conf. bash-3.00# more /opt/openv/java/auth.conf root ADMIN=ALL JBP=ALL  From the Help file :
 * ADMIN=JBP JBP=ENDUSER+BU+ARC
 * First field is user name. An asterisk here sets that any user name is acceptable (can't be used to authorize all users administrator capabilities).
 * to deny capabilities for a specific user, add a line for this user before a line that starts with an asterisk. To deny all just do something like "joe ADMIN= JBP="
 * The ADMIN keyword specifies what applications the user can run.
 * ALL - all
 * AM - Activity Monitoring
 * BMR - Bare Metal Restore
 * BPM - Backup Policy Management
 * BAR or JBP - Backup, Archive, and Restore
 * CAT - Catalog
 * DM - Device Monitor
 * HPD - Host Properties
 * MM - Media Management
 * REP - Reports
 * SUM - Storage Unit Management
 * VLT - Vault Management
 * The JSB keyword specifies what a user can do with Backup, Archive, and Restore client application (jbpSA). JBP=ALL allows access to all these capabilities including administration. The other options are :
 * ENDUSER - allowed to do restores
 * BU - allowed to do backups
 * ARC - allowed to do archive tasks (need BU permissions as well)
 * RAWPART - allowed to doraw partition restores
 * ALL (see above)