User Tools

Site Tools


apps:netbackup:cli

This is an old revision of the document!


NetBackup - CLI

Server

Convert timestamp to a human readable format

# bpdbm -ctime 1441252847
1441252847 = Thu Sep 03 06:00:47 2015

or use GNU awk

# echo 1441252847 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S",$0) }'
2015-09-03 06:00:47

Resolve Status Codes

# bperror -S 96
unable to allocate new media for backup, storage unit has none available
The NetBackup Resource Broker (nbrb) did not allocate a new volume for backups. This error indicates that the storage unit has no more volumes available in the volume pool that is specified for this backup. Note that NetBackup does not change storage units during the backup.

Show Status Code Recommendations

# bperror -S 96 -r
unable to allocate new media for backup, storage unit has none available
The NetBackup Resource Broker (nbrb) did not allocate a new volume for backups. This error indicates that the storage unit has no more volumes available in the volume pool that is specified for this backup. Note that NetBackup does not change storage units during the backup.

Check the NetBackup Problems report to determine the storage unit that is out of media.
* If the storage unit is a robot with empty slots, add more volumes (remember to specify the correct volume pool).
* If there are no empty slots, move some media to nonrobotic and then add new volumes.
...
The mds unified logging files (OID 143) usually show the NetBackup media selection process.
More troubleshooting information in a wizard format is available for this status code.
http://www.symantec.com/business/support/index?StatusCode=96
Click here to view technical notes and other information in the Symantec Knowledge Base about this status code.

Expire Tape

# bpexpdate -m L30000 -d 0 -force
Media L30000 is due to expire at 01/01/1970 01:00:00
Are you sure that the data on this media is not critical to
your business, and you are sure you want to delete L30000 y/n (n)?

Show Brief Tape Content

# bpimmedia -mediaid L30071  -L | grep "^[^ ]"                                                                                                                                
Backup-ID            Policy     Type  RL  Files   C  E  T  PC  Hold  Indexing     Expires
Copy Frag    KB Type Density FNum      Off       Host       DWO MPX Expires                  RL Hold MediaID
-----------------------------------------------------------------------------------------------------
myNBClient0_1440918059  F_Full_on_ FULL  1   816     N  N  R  1   0     0            Sun Sep 13 09:00:59 2015
myNBClient0_1439708452  F_Full_on_ FULL  1   247544  N  N  R  1   0     0            Sun Aug 30 09:00:52 2015
myNBClient1_1439708412  F_Full_on_ FULL  1   20969   N  N  R  1   0     0            Sun Aug 30 09:00:12 2015

Show Backed Up Files of a Client Since a Date

# bplist -C myNBClient0 -s 01/21/2015 -R -b -l -k myBackupPolicy /tmp                                                                                                         
drwxr-xr-x root      root                0 Aug 08 04:25 /tmp
-rw-r--r-- root      root        49145860K Aug 08 04:25 /tmp/mydir/myfile1
-rw-r--r-- root      root              200 Aug 08 04:25 /tmp/mydir/myfile2

Show Backed Up Files by BackupID

# bpflist -client myNBClient0 -backupid myNBClient0_1421224742 -d 01/21/2015 -rl 999 -pattern /tmp
FILES 10 0          0 1421224742 0 myNBClient0 myBackupPolicy myNBClient0_1421224742 - *NULL* 19 0 unknown unknown 0 0 *NULL*
5 0 37 52 138876830 1 0 0 64774 /tmp/mydir/myfile1 33188 root root 200 1421161365 1421161365 1421183429
6 0 38 54 138876834 1 0 0 64774 /tmp/mydir/myfile2 33188 root root 10465 1421161365 1421161365 1421183429

Show Retention Levels with According Time

# bpretlevel -l
0 604800 1 week
1 1209600 2 weeks
2 1814400 3 weeks
3 2678400 1 month
4 5356800 2 months
5 8035200 3 months
6 16070400 6 months
7 24105600 9 months
8 31536000 1 year
9 2147483647 infinite
...
24 2147483647 infinite

Get a Client-Policy List

# bppllist -allpolicies | awk '/^CLASS/{ current_policy=$2 } /^CLIENT/{ print $2,current_policy }' | sort
myClient00 myPolicy00
myClient00 myPolicy01
myClient01 myPolicy00
myClient03 myPolicy01

Tape Usage

Get approximate numbers about tape usage of a library.

# bpmedialist -l | awk 'BEGIN{sum=0;tcount=0;} { if($12!=9 && $11!=0){sum+=$9; tcount++;} } END { print "total capacity:",sum/1024/1024/1024, "TB"; prin count; pro_tape_GB=sum/tcount/1024/1024; print "average data per tape:",pro_tape_GB, "GB"; print "compression ratio:", pro_tape_GB/400 }'
total capacity: 370.917 TB
average data per tape: 566.05 GB
compression ratio: 1.41512

pro_tape_GB/400: divided by 400 because of LTO3.

Client

show open files and connections while a backup is running

lsof -n -P -p $(pgrep "bpbkar|bpfilter" | xargs | tr ' ' ',') | grep -v REG
lsof -n -P -p $(pgrep "bpbkar|bpfilter" | xargs | tr ' ' ',') | awk '{ if($4!="mem" && $5!="DIR"){print} }'
apps/netbackup/cli.1444938148.txt.gz · Last modified: 2015-10-15 21:42 by root