NetBackup
From My Admin Page
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
# vmchange -res -robot_info -verbose -rn 0 -rt TLD -rh <host> 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: STK~~~~~SL500~~~~~~~~~~~1300.
Eject tapes
Eject TL8 or TLD volumes (syntax) vmchange -res -multi_eject [-w] [-verbose] -rn <robot_number> -rt <robot_type> -rh <robot_control_host> -ml <media_id:media_id:...:media_id>
** 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 <HOST> -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. ** NOTE: Be sure to run vmupdate afterwards *** /usr/openv/volmgr/binvmupdate -rt TLD -rn 0 -rh $MEDIA_HOST
Show Job Activity
/opt/openv/netbackup/bin/admincmd/bpdbjobs -report
Scripts
Show contents of tape
#!/bin/ksh if [ $# -eq 1 ]; then /usr/sbin/nsr/mminfo -avot -q '!ssrecycle,'volume=$1 else echo "Syntax is $0 <tape_volume_name>" fi
Manually recycle Tape
#!/bin/ksh if [ $# -eq 1 ]; then /usr/sbin/nsr/nsrjb -LRYv $1 else echo "Syntax is $0 <tape_volume_name>" fi
Eject Multiple Tapes
#!/bin/ksh MEDIA_HOST=backuphost if [[ $# != 1 ]] then echo "enter tape #'s seperated by colons (i.e. A2200:A2201:A2202)" read j echo "Ejecting Tapes: $j" else j=$1 fi 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
#!/bin/sh SCHEDULE=<schedule> #For example,"Monthly_Full" echo echo "Month End tapes to pull:" echo "========================" # checks 20 days back for any with backup schedule named $SCHEDULE /usr/openv/netbackup/bin/admincmd/bpimagelist -sl $SCHEDULE -U -media -hoursago 480 2>&1 echo
Eject Monthly Tapes
#!/bin/ksh MEDIA_HOST=<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
#!/bin/sh ######################### # Shows tapes in jukebox # and how much has been # written to them ######################### ###################################################### # REMEMBER: Don't assume path variables are set right ###################################################### 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 # # 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
#!/bin/ksh ############################ # Totals up how much backed # 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
#!/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 # $ECHO ; $ECHO "====== Contents of Media Written ===============================" Written_Contents
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 * ADMIN=JBP JBP=ENDUSER+BU+ARC
From the Help file :
- 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)