Enterprise Data Services Community Blog
2 MIN READ
Handy NetBackup Linux Shell One Liners - Volume 1
13 years ago
Below are a few shell one liners I use and/or have in a cron job. If you'd like me to post more, let me know and I'll continue to share.
-----
Activate SLPs
for SLPS in SLPNAME1 SLPNAME2 SLPNAME3; do /usr/openv/netbackup/bin/admincmd/nbstlutil active -lifecycle slp-${SLPS} ; done
Disable SLPS
for SLPS in SLPNAME1 SLPNAME2 SLPNAME3; do /usr/openv/netbackup/bin/admincmd/nbstlutil inactive -lifecycle slp-${SLPS} ; done
Show pending SLP jobs (SLPs must be active to get correct job information)
for SLPS in SLPNAME1 SLPNAME2 SLPNAME3; do echo"" ; echo "**** slp-$SLPS ****"; nbstlutil report -lifecycle slp-$SLPS ; done
Show all clients in a departments policy
for policy in /usr/openv/netbackup/bin/admincmd/bppllist | grep -i department ; do echo ${policy}; /usr/openv/netbackup/bin/admincmd/bpplclients ${policy}; echo; done
List available scratch tapes in physical library
/usr/openv/volmgr/bin/vmquery -b -pn Scratch | grep -v HCART3
List available scratch tapes in virtual library
/usr/openv/volmgr/bin/vmquery -b -pn Scratch | grep HCART3
Count total number of scratch tapes available
/usr/openv/volmgr/bin/vmquery -pn Scratch | grep -c "robot slot"
List current drive paths that are down
/usr/openv/volmgr/bin/vmoprcmd | grep DOWN
Show the files and KB backed up for a client named clientA for the previous 15 days (24 hours *15 days =360 hours )
/usr/openv/netbackup/bin/admincmd/bpimagelist -hoursago 360 -U -client clientA |awk '{file+=$4} {kb+=$5} END {print file" " kb}'
List the tapes used for a specific client over the previous 15 days (24 hours *15 days =360 hours )
/usr/openv/netbackup/bin/admincmd/bpimagelist -hoursago 360 -U -client client_name -media
Make better use of mail_bp_reports. After doing this, 3 different reports will be emailed to you.
Edit the "/opt/openv/netbackup/bin/goodies/mail_bp_reports" script as shown below:
#!/bin/sh MAILTO=youremail@address.com
Then add $MAILTO to the end of the lines containing "mail_cmd":
cat $OUTFILE | mail_cmd "My Company's NetBackup backup status" $MAILTO cat $OUTFILE1 | mail_cmd "My Company's NetBackup problems log" $MAILTO cat $OUTFILE2 | mail_cmd "My Company's NetBackup cleaning stats" $MAILTO
Published 13 years ago
Version 1.0Enterprise Data Services Community Blog
Enterprise Data Services Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the community.