apps:netbackup:cli
Table of Contents
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.
Find by Pattern in Backups
The following example searches for the pattern *tmp* in all files and directories which are backuped by FULL Schedules within the last two weeks.
# nbfindfile -c myClient0 -p "*tmp*" -st FULL -s_ut $(($(truss /usr/bin/date 2>&1 | awk -F"=" '/^time/{print $2}' | tr -d ' ')-(60*60*24*14))) ========================================================== Client : myClient0 Policy : myPolicy0 Backup Time : Sun Oct 25 09:00:09 2015 (1445760009) Backup ID : myClient0_1445760009 ========================================================== /var/adm/utmpx /var/adm/wtmpx /var/adm/wtmpx.0 /var/adm/wtmpx.1 /var/sadm/pkg/SUNWcsr/save/pspool/SUNWcsr/reloc/etc/default/utmpd /var/sadm/pkg/SUNWcsr/save/pspool/SUNWcsr/reloc/var/adm/utmpx /var/sadm/pkg/SUNWcsr/save/pspool/SUNWcsr/reloc/var/adm/wtmpx /var/svc/log/system-rmtmpfiles:default.log /var/svc/log/system-utmp:default.log /var/svc/manifest/system/rmtmpfiles.xml /var/svc/manifest/system/utmp.xml /var/tmp/ ========================================================== Client : myClient0 Policy : myPolicy0 Backup Time : Sun Oct 25 09:00:07 2015 (1445760007) Backup ID : myClient0_1445760007 ========================================================== /export/home/asdf/.ssh/gtmp
Manage exclude_list of UNIX/Linux clients from the server
If there is a client like “myClient” and the exclude_list have to be edited but only access to the master server is available, then copy the exclude_list to the master server (local file may be called “myClient-exclude_list”):
# bpgetconfig -e myClient-exclude_list myClient
The copied file is a normal text file. Entries can be added or removed. This file can be sent back to the server:
# bpsetconfig -e myClient-exclude_list -h myClient
Search in all Backups of a Client
Windows
# nbfindfile -c myClient0 -only_files -p "*.mdf" -s_ut 0 -l -pt MS-Windows ========================================================== Client : myClient0 Policy : myWinPolicy Backup Time : Thu 07 Jan 2016 12:21:20 AM CET (1452122480) Backup ID : myClient0_1452122480 ========================================================== -rwx------ root;Admi root;None 5636096 Dec 21 14:23:26 D:\SQLData\MSSQL12.ASDF01\MSSQL\DATA\master.mdf * -rwx------ root;Admi root;None 4390912 Dec 21 14:23:26 D:\SQLData\MSSQL12.ASDF01\MSSQL\DATA\model.mdf * -rwx------ root;Admi root;None 17956864 Dec 21 14:23:26 D:\SQLData\MSSQL12.ASDF01\MSSQL\DATA\MSDBData.mdf * -rwx------ root;MSSQ root;MSSQ 8388608 Dec 21 14:23:51 D:\SQLData\MSSQL12.ASDF01\MSSQL\DATA\tempdb.mdf * ========================================================== Client : myClient0 Policy : myWinPolicy Backup Time : Mon 28 Dec 2015 12:04:47 AM CET (1451257487) Backup ID : myClient0_1451257487 ========================================================== -rwx------ root;SYST root;SYST 41943040 Apr 20 2015 C:\Program Files\Microsoft SQL Server\MSSQL12.ASDF01\MSSQL\Binn\mssqlsystemresource.mdf * -rwx------ root;SYST root;SYST 4194304 Feb 21 2014 C:\Program Files\Microsoft SQL Server\MSSQL12.ASDF01\MSSQL\Binn\Templates\master.mdf * -rwx------ root;SYST root;SYST 2293760 Feb 21 2014 C:\Program Files\Microsoft SQL Server\MSSQL12.ASDF01\MSSQL\Binn\Templates\model.mdf * -rwx------ root;SYST root;SYST 13434880 Feb 21 2014 C:\Program Files\Microsoft SQL Server\MSSQL12.ASDF01\MSSQL\Binn\Templates\msdbdata.mdf *
Linux
# nbfindfile -c myClient1 -only_files -p "system.sh" -s_ut 0 -l ========================================================== Client : myClient1 Policy : myStdPolicy Backup Time : Mon 04 Jan 2016 11:01:43 PM CET (1451944903) Backup ID : myClient1_1451944903 ========================================================== -rwx------ root root 63 Oct 14 15:47:47 /opt/asdf/system/system.sh * ========================================================== Client : myClient1 Policy : myStdPolicy Backup Time : Thu 31 Dec 2015 07:06:14 PM CET (1451585174) Backup ID : myClient1_1451585174 ========================================================== -rwx------ root root 63 Oct 14 15:47:47 /opt/asdf/system/system.sh *
Create a List of all Clients with Client-Version and OS
# for client in $(bpplclients -allunique -l | awk '{ print $2 }'); do info=$(bpgetconfig -s "${client}" -l 2>/dev/null); if [[ ! -z "${info}" ]]; then echo "${client};${info}"; fi; done myClient01;Client of myMasterServer;Linux, SuSE2.6.16;7.5.0;NetBackup;7.5;750000;/usr/openv/netbackup/bin;Linux 3.12.51-52.31-default ; myClient02;Client of myMasterServer;Linux, SuSE2.6.16;7.6.0;NetBackup;7.6;760000;/usr/openv/netbackup/bin;Linux 3.12.28-4-default ; myClient03;Client of myMasterServer;PC-x64, WindowsXP;7.6.1;NetBackup;7.6;760000;C:\Program Files\VERITAS\NetBackup\bin;Windows2012 6 ;
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.txt · Last modified: 2016-07-05 22:53 by root