Thursday, May 10, 2012

Netbackup Commands

http://www.bettssoftware.com/docs/tips-netbackup.html

Starting and Stopping Netbackup

Stopping Netbackup
  • /usr/openv/netbackup/bin/K77netbackup --> graceful shutdown
  • /usr/openv/netbackup/bin/bpps -a --> check for any remaining processes
  • /usr/openv/netbackup/bin/goodies/bp.kill_all ---> kills all remaining netbackup processes, not necessarily graceful
  • /usr/openv/netbackup/bin/bpps -a --> check for any remaining processes
  • kill -9 <pid> for any remaining. NOTE: unkillable processes may require a reboot
  • For Unix master, when backups, restores and duplications are not running, please do the following on the master server:
    1. stop NetBackup (netbackup stop) in the default folder: /usr/openv/netbackup/bin/goodies
    2. bpps -a , kill the remaining processes
    3. cd to /usr/openv/netbackup/db/jobs
    4. rm the bpjobd.act.db file
    5. cd up to the restart folder (/usr/openv/netbackup/db/jobs/restart)
    6. pwd to verify, rm all files
    7. cd..\trylogs
    8. pwd to verify, rm all files
    9. cd..\ffilelogs
    10. pwd to verify, rm all files
    11. restart NetBackup (netbackup start) in the default folder: /usr/openv/netbackup/bin/goodies
    Note: This will not delete the Activity Monitor History. Completed jobs are stored in bpjobd.db file, so do not remove it.
Starting Netbackup
  • /usr/openv/netbackup/bin/S77netbackup --> after bp.kill_all, to restart

Common Tasks

Starting the Administration GUI
  • java from the windows client
  • x-windows from the server - /usr/openv/netbackup/bin/xnb &
Checking Backup Status
  • Activity Monitor or
  • /usr/openv/netbackup/bin/admincmd/bpdbjobs -report
Cleaning a tape manually
  • Identify the drive name to be cleaned
    • tpclean -L
  • Manually clean the drive:
    • tpclean -C <drive name>
Determining what tapes were used for a backup
  • GUI
    • Backup and Restore --> Find the file system --> Preview Media Button
  • CLI
    • Find the correct backup images
      • bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE>
    • Find the media used for those images
      • bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE> -media
Listing the files in a backup
Find the tape(s) used (above procedure using bpimagelist)
cd /usr/openv/netbackup/db/jobs/done
Run the following script and redirect it's output to a text file:
for file in `grep MOUNTING *|grep <MEDIA_ID>|awk '{print $1}'|sed 's/:MOUNTING//'`
do
echo $file
grep PATH_WRITTEN $file|awk '{print $3}'
echo " "
echo "==========================================End of Image======================================"
echo " "
done


This process works for NBU V3.4:
  • cd /usr/openv/netbackup/db/images/<CLIENT>
  • ls -ltr --> this will identify the directory with the proper date
  • verify directory with "bpdbm -ctime <Unixtime>
  • cd <Unixtime>
  • ls -ltr --> lists all of the backups for this client on this date
  • cat <POLICY>_<Unixtime>_<BU Type>.f | awk '{print $10}' --> this prints out the files in the backup
For NBU > V3.4
  • bpflist --help --> undocumented netbackup command to list files from a binary .f file

Inventory the Robot
  • Inventory Robot --> /opt/openv/volmgr/bin/vmcheckxxx -rt robot_type -rn robot_number -list (where robot_type is tld, acs, . . .)
  • Inventory Robot and Update Configuration --> /opt/openv/volmgr/bin/vmupdate -rt robot_type -rn robot_number -list (where robot_type is tld, acs, . . .)
Listing Properties of the Volume Pools
  • vmpool -listall
Scratch Tapes
  • Count scratch tapes: /usr/openv/volmgr/bin/vmquery -pn Scratch | grep -c "robot slot"
  • Moving tapes to the scratch pool
    • If Needed - Expire the tape
      • bpexpdate -ev <TAPE ID> -d 0 -force -host <Media Manager>
    • Move the tape
      • vmchange -p 2 -m <TAPE ID>
Checking Drive Usage
  • /usr/openv/volmgr/bin/vmoprcmd
Taking a drive down or up
  • /usr/openv/volmgr/vmoprcmd -down <drive index>
  • /usr/openv/volmgr/vmoprcmd -up <drive index>
Performing a Restore
  • From the GUI
    • user backup & restore --> configuration --> client
    • user backup & restore --> configuration --> client to restore
    • directory to search
    • directory depth
    • date range
    • file --> browse backups for restore
Adding New Tapes to the Library
  • Using the GUI
    • Media Management --> Actions --> New --> Single Volume . . -->
    • Media Type (ie DLT)
    • Robot Type (ie TLD)
    • Media ID (from Inventory)
    • Slot Number (from Inventory)
    • Robot Number (ie 0)
    • Volume Group
    • Volume Pool (ie Scratch)
  • Using the CLI
    • vmadd -m <media id> -mt <tape type> -verbose -rt <robot type> -b <barcode> -rn <robot number> -rc1 <slot> -p <pool number> -mm <max mounts>
      • vmpool -listall --> lists all pools, both name and number
    • For example: vmadd -m 000151 -mt dlt -verbose -rt tld -b 000151 -rn 0 -rc1 8 -p 2 -mm 0
Re-using Tapes from other systems or older Netbackups
  • Expire the media
    • bpexpdate -ev MEDIA_ID -d 0 -force -host HOST
  • Deassign the media
    • vmquery -deassignbyid MEDIA_ID 4 0
  • Move to the scratch pool
    • vmchange -m MEDIA_ID -p POOL#
  • Relabel the media
    • bplabel -ev CIM572 -d dlt -p Scratch
Changing the attributes of media
  • Changing the barcode
    • vmchange -barcode CYM100D -m CYM100
  • Changing the Volume Pool
    • vmchange -m MEDIA_ID -p POOL#
To expire media
  • bpexpdate -ev <medai id> -d 0 -force -host <media server>
To unfreeze media
  • List the frozen media
    • /usr/openv/netbackup/bin/goodies/available_media | grep -i FROZEN
  • Unfreeze the media
    • bpmedia -unfreeze -ev <media id> -h <media server>
To relabel a tape
  • bplabel -ev <media id> -d <tape density> -p <pool name>
  • bplabel -ev 000687 -d dlt -p TriVrgt_OFFSITE
To remove media from the Netbackup database
  • Verify that there are no images on the tape
    • bpimmedia -mediaid 000687 -L
  • Expire the tape
    • bpexpdate -ev 000687 -d 0 -host scorpius -force
  • Get the status and pool number of the tape
    • vmquery -m 000687
  • Deassign the tape
    • vmquery -deassignbyid <media id> <pool number> <status code from vmquery -m>
    • vmquery -deassignbyid 000687 4 0x0
  • Delete the tape
    • vmdelete -m 000687
Installing the Netbackup Client
  • /update_clients -ForceInstall -ClientList /tmp/clients.lst
    • requires that TMPDIR and TEMPDIR be set correctly
Excludng files from backup on a client
  • Create /usr/openv/netbackup/exclude_list
  • Put the file specifications of the files/directories to be excluded
    • /mnt/directory/*
Displaying Information about a Tape
  • vmquery -m <media id> --> Displays attributes about a particular tape
  • bpmedialist -U -mcontents -ev 000687 --> Displays media contents
  • bpmedialist -U -mlist --> List of all media
  • bpmedialist -U -mlist -ev CYM966 --> Listing of a particular media id
  • bpimmedia -mediaid 000687 -L --> Listing of images on a tape

Robtest Commands

  • Starting robtest
    • robtest
    • 1 --> to select TLD 0
  • Getting help
    • ?
  • Looking at contents of the tape drives
    • s d
  • Looking at the contents of the library
    • s s
  • Moving a tape from a drive to a library slot
    • s d --> to identify drive number that has tape (Contains Cartridge = yes, Barcode=XXXXXX)
    • s s --> to identify an empty slot in the tape library (Netbackup will need to be re-inventoried)
    • m d# s# --> from from drive # to slot #
    • s d --> verify the tape drive is empty
    • s s --> verify the library slot has the tape

Configuration Files

/usr/openv/netbackup/bp.conf
  • configuration file, sets backup server and backup clients
  • force statement must be correct
  • client to browse from
  • client to restore to
/usr/openv/volmgr/vmconf

Logfiles

To utilize logfiles, create the corresponding directory in /usr/openv/netbackup/logs

Server Logfile directories:
  • admin - adminstrative commands
  • bpbrm - backup and restore manager
  • bpcd - client daemon
  • bpdbjobs - database manager program process
  • bpdm - disk manager process
  • bpjava-msvc - Java application server authentication service
  • bpjava-usvc - process that services Java requests
  • bprd - request daemon process
  • bpsched - scheduler process that runs on master servers
  • bptm - tape/optical media management process
  • user-ops - required directory for use by Java programs
  • xbpadm - X based administration utility
  • xbpmon - X based job monitor process
Client Logfile directories:
  • bp - client user interface process
  • bparchive - archive program
  • bpbackup - backup program
  • bpbkar - program that generates golden images
  • bpcd - client daemon
  • bpjava-msvc - Java application server authentication service
  • bpjava-usvc - process that services Java requests
  • bplist - program that lists backed up and archived files
  • bpmount - program that determines local mountpoints and wildcard expansion for multiple streams
  • bphdb - Oracle database backup program start process
  • db_log - database specific extension log
  • tar - tar process log during restores
  • user_ops
Media Manager logging automatically goes to the system log using syslogd logging facility

.Logging will only occur if these directories are created. These directories will generate a lot of data and should be deleted when no longer necessary.

To increase the amount of logging information set VERBOSE=2 in /usr/open/netbackup/bp.conf (default is VERBOSE=1)

Processes

ltid
acsd
vmd

Useful Commands

bpcllist - list classes
bpclinfo <class> -L --> displays info about a class
vmpool - volume pools
vmpool -listall
vmpool -listscratch
bplabel -ev <media id> -d hcart
bpbackup db --> backs up the catalog
bpclclients <policy> --> lists the clients for a particular policy (class)

Troubleshooting

bperror -statuscode <-- displays information about the netbackup error.

No Backups are running:
  • Check system log file for error messages
  • Stop and restart all the netbackup processes
  • Look for a downed drive
    • /usr/openv/volmgr/bin/vmoprcmd
    • /usr/openv/volmgr/bin/vmoprcmd -up 0 --> this will bring up drive 0 if it's control shows as down
  • Look for pending requests
    • /usr/openv/volmgr/bin/vmoprcmd or gui --> device management
    • If there is a pending request either re-assign it to a drive, or deny the request
Downed drive does not come back up or does not stay up
  • Check for a hardware problem by looking for messages on the tape library
  • Make sure there is not a tape stuck in the drive
    • Use robtest (described above) to look at the drives
      • If there is a tape stuck in the drive, try to remove it using robtest
      • If robtest fails, then you must manually remove it.
Verify the Client is communicating properly:
  • bpclncmd -ip <ip address> --> from both client and server
  • bpclntcmd -hn <hostname> --> from both client and server
  • bpclntcmd -pn --> from client only

Device Actions

Device Management --> info about tape drives
  • dlt
  • hcart (ultrium)

Media Actions

Media id must agree with # of the tape
Create a media id
  • actions -->new-->single volume-->dlt cart (not dlt2)
  • put it into the "netbackup" volume pool

Netbackup Client

To check things out do this:

It could be a couple things. Mostly DNS, bp.conf, or something stupid. On
the client run this command

/usr/openv/netbackup/bin/bpclntcmd -pn

/usr/openv/netbackup/bin/bpclntcmd -server "server name"

/usr/openv/netbackup/bin/bpclntcmd ip "ip_address"

One of these usually fails and your able to fix it right off


1074 ./bpclntcmd -hn corpbu1
1075 ./bpclntcmd -ip 10.194.1.129
1076 ping 10.194.1.129
1077 ./bpclntcmd -hn corpldv1
1078 ./bpclntcmd -hn corpbu1.corporate.vox.net
1079 ping corpldv1
1080 ./bpclntcmd -ip 10.194.1.120

Must be able to resolve correctly from the master server and the client or it will not work!!!

Restore

/usr/openv/netbackup/bin/bprestore -B -l [-S netbackup01-man] [-C satellite01-man -D satellite01-man] -R /tmp/rename -s 03/30/12 -e 04/01/12 [-L /tmp/r.log] -f /tmp/filelist

When using bprestore to recover files and directories, occasionally there will be a need to exclude some of the files and directories. Bprestoreprovides this facility with the aid of the exclamation mark ( ! ). The exclamation mark goes before the file or directory name to be excluded. It can be added from the command line, or placed within a separate file list.
Note: This procedure is not valid when doing Network Data Management Protocol (NDMP) restores.
Command Example 1:This example would restore the "dir" path. However, it will omit the "dir2" directory.
UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> /dir !/dir/dir1/dir2

Windows (from the NetBackup\bin directory):
bprestore -C< client_name> -L <log_filename> -t <policy_type> C:\dir !C:\dir\dir1\dir2

Command Example 2:A file list file is more useful when there is a long list of files and directories. The command line for bprestore, using a file list would look like:

UNIX:/usr/openv/netbackup/bin/bprestore -C <client_name> -L <log_filename> -t <policy_type> -f <filelist_filename>

Windows (from theNetBackup\bin directory):
bprestore -C <client_name> -L <log_filename> -t <policy_type> -f< filelist_filename>

File ListsBelow is a very simple example of how a file list file would look:
UNIX:
/dir
!/dir/dir1/dir2
Windows:
C:\dir
!C:\dir\dir1\dir2

If there are any spaces between the file or directory names, the character count must appear before the pathname. The file list would then look similar to the following:
UNIX:
4 /dir
5 /dir2
14 /dir3/filename
15 !/dir/dir1/dir2
Windows:
11 C:\programs
8 C:\winnt
22 C:\documents\old memos
17 !C:\programs\test

restore to an alternate path on the client
1. Create a rename file
Use the following form for the entries in the rename file:
change backup_filepath to restore_filepath
The file paths must start with / (slash).
For example, the following entry in the rename file named /home/admin/rename will restore  /usr/Dir1 to /usr/Dir2.
change /usr/Dir1 to /usr/Dir2
2. The syntax for the bprestore command.
/usr/openv/netbackup/bin/bprestore -l -R rename_file filenames
For example, the following command will restore directories and files under /usr/Dir1 to /usr/Dir2.
/usr/openv/netbackup/bin/bprestore -l -R /home/admin/rename /usr/Dir1
The -l specifies that all UNIX hard and soft links be changed.

http://linuxdynasty.org/69/netbackup-troubleshooting-how-to/

Netbackup Cheat Sheet (based on pre-NBU 6.0 information)
http://www.datadisk.co.uk/html_docs/veritas/veritas_netbackup_cs.htm

Master Server Daemons/Processes
Request daemon bprd
Schedulerbpsched (started with bprd)
Netbackup database manager bpdbm (started with bpsched)
Job Monitor bpjobd (started with bpdbm)
Media Server Daemons/Processes
Communications daemon bpcd
Backup and restore managerbpbrm (started with bpcd)
Tape Manager bptm (started with bpbrm)
Disk Manager bpdm (started with bpbrm)
Media Manager ltid
Bar code reader avrd (started with ltid)
Remote device management/ controls volume database vmd (started with ltid)
Roboticdaemon (one on each media server) talks to tldcd tldd (started with ltid)
Robotic control daemon talks to the robot directl via scsi tldcd (started with ltid)
Catalogs
Master Server
Information about backed-up files image - /opt/openv/netbackup/db
Storage Unit, Global Configuration, Catalog backup configuration. config - /opt/openv/netbackup/db
Backup Policy information class - /opt/openv/netbackup/db
Job status information jobs - /opt/openv/netbackup/db
Netbackup logs with error and status information error - /opt/openv/netbackup/db
Information on volumes, volume pools, scratch pool and volume groups volume - /opt/openv/volmgr/database
Media Server
Tracks assigned volumes (media that has data them) media - /opt/openv/netbackup/db
Information about devices managed by the media serverdevice - /opt/openv/volmgr/database
Log and Information Files
Netbackup and Patch versions /opt/openv/netbackup/bin/version
Media Version /opt/openv/volmgr/version
Patch Level history/opt/openv/netbackup/patch/patch.history
Buffer size /opt/openv/netbackup/db/config/SIZE_DATA_BUFFERS
Number of buffers /opt/openv/netbackup/db/config/NUMBER_DATA_BUFFERS
Network Buffer Size/opt/openv/netbackup/NET_BUFFER_SZ (default = 32)
Java GUI authorisation /opt/openv/java/auth.conf
Catalog type (binary or ASCII)/opt/openv/netbackup/db/config/cat_format.cfg
Netbackup and media manager parameter files /opt/openv/netbackup/bp.conf
/opt/openv/volmgr/vm.conf
Corrupt Database image files (5.0 and above) /opt/openv/netbackup/db.corrupt
Server Commands
Check license details /opt/openv/netbackup/bin/admincmd/get_license_key
Start Netbackup netbackup start

/opt/openv/netbackup/bin/initbprd (master)
/opt/openv/volmgr/bin/vmd (media)
Stop Netbackup (does not disconnect GUI sessions) netbackup stop
/opt/openv/netbackup/bin/admincmd/bprdreq -terminate (master)
/opt/openv/netbackup/bin/bpdbm -terminate (master)
Stop Netbackup and kill all GUI sessions /opt/openv/netbackup/bin/goodies/bp.kill_all
Start the GUI /opt/openv/netbackup/bin/jnbSA
Scan for tape devicessgscan (solaris)
ioscan (HPUX)
Display all Netbackup processes bpps -a
lists servers errors
bperror -U -problems -hoursago <number of hours>
bperror -U -backstat -by_statcode -hoursago <number of hours>

display information on a error code bperror -statuscode <statuscode> [-recommendation]
Reread bp.conf file without stopping Netbackupbprdreq -rereadconfig
Check database consistency bpdbm -consistency 1
bpdbm -consistency 2
Check for the below lines:
Bad image header
Does not exist
Netbackup Recovery
Device catalog is intactbprecover -l -m <media ID> -d dlt (listing)
bprecover -r -m <media ID> -d dlt (recovering)
Device catalog is gone or corrupted bprecover -l -tpath <tape_path> (listing)
bprecover -r -tpath <tape_path> (recovering)
Disk backups bprecover -l -dpath <disk_path> (listing)
bprecover -r -dpath <disk_path> (recovering)
Volume Commands
Tape Drive and Inventory Commands
List drive status, detail drive info and pending requests vmoprcmd
List the tape drive status vmoprcmd -d ds
List the pending requests vmoprcmd -d pr
Control a tape device vmoprcmd [-reset][-up][-down] <drive number>
List all changes in the robot(but do not update)vmupdate -recommend -rt tld -rn 0
vmcheckxxx -rt tld -rn 0 -recommend
Empty the robot and re-inventory (using barcodes) vmupdate -rt tld -rn <robot number> -rh <silo slave> -vh <host> -nostderr -use_barcode_rules -use_seed -empty_ie
Tape Media Commands
List all pools vmpool -listall -bx
List tapes in pool vmquery -pn <pool name> -bx
List all tapes in the robot vmquery -rn 0 -bx |grep 'TLD' | sort +4
List cleaning tapes vmquery -mt dlt_clean -bx
List tape volume details vmquery -m <media ID>
Delete a volume from the catalog vmdelete -m <media ID>
Change a tapes expiry date vmchange -exp 12/31/06 23:59:58 -m <media ID>
Change a tape's media pool vmchange -p <pool number> -m <media ID>
Media commands
List the storage units bpstulist -U
Freeze or unfreeze media bpmedia [-freeze][-unfreeze] -ev <media ID>
List media details bpmedialist -ev <media ID>
List media contents bpmedialist -U mcontents -m <media ID>
List backup Image Information bpimagelist -backupid <image ID>
Expire client images bpimage -cleanup -allclients
Expire a tape bpexpdate -d 0 -ev <media ID> -force
List all netbackups jobs bpdbjobs -report [-hoursago]
Move media from one media server to another bpmedia -movedb -newserver <media server> -oldserver <media server>
Tape/Robot commands
List tape drivestpconfig -d
List cleaning times on drives tpclean -L
clean a drive tpclean -C <drive number>
change a drives cleaning frequency tpclean -F <drive> <frequency>
set a drives cleaning time to zero tpclean -M <drive>
Move tapes within robot using robtest robtest
commands that can be used are as follows:

s s (show slots)
s d (show drives)
s i (show load port)
m s250 d5 (move tape from slot 250 into drive 5)
uload d5 (unload tape from drive 5)
m d5 s250 (move tape from drive 5 to slot 250)
m s250 i1 (mov tape from slot 250 to load port 1)
List load port tapes echo "s i q" | tldtest -r /dev/sg/c0t4l0
List all slot contents echo "s s q" | tldtest -r /dev/sg/c0t4l0
List tape drive contents echo "s d q" | tldtest -r /dev/sg/c0t4l0
Move a tape in s100 to drive 1 echo "m s100 d1" | tldtest -r /dev/sg/c0t4l0
Move a tape to load port 1 echo "m s100 i1" | tldtest -r /dev/sg/c0t4l0
Archiving Commands
list archive info bpcatlist -client all -before Jul 01 2006
bpcatlist -client all -before Aug 01 2006
archive and remove images bpcatlist -before Jul 01 2006 | bpcatarc | bpcatrm
restore archive files bpcatlist -before Jul 01 2006 | bpcatres
Client commands
test client connectivitybpclntcmd [-ip <ip addres>]
bpclntcmd [-hn <hostname>]
bpclntcmd [-pn]
bpclntcmd [-sv]
List clientsbpplclients
Reports 
(<start_date> and <end_date> syntax: MM/DD/YY
 <start_time> and <end_time> syntax: hh:mm:ss
 <media_id> is the six-character media identification number)

List policies
List detailed policies
bppllist -U
bppllist -U -allpolicies
Backup Status Reportbperror -U -backstat -s info [-d <start_date> <start_time> -e <end_date> <end_time>]
Client Backups Reportbpimagelist -U [-A|-client name] [-d <start_date> <start_time> -e <end_date> <end_time>]
Problems Reportbperror -U -problems [-d <start_date> <start_time> -e <end_date> <end_time>]
All Log Entries Reportbperror -U -all [-d <start_date> <start_time> -e <end_date> <end_time>]
Media List Reportbpmedialist -U -mlist [-m <media_id>
Media Contents Reportbpmedialist -U -mcontents [-m <media_id>]
Images on Media Reportbpimmedia -U [-client <client_name>] [-mediaid <media_id>]
Media Log Entries Reportbperror -U -media [-d <start_date> <start_time> -e <end_date> <end_time>]
Media Summary Reportbpmedialist -summary
Media Written Reportbpimagelist -A -media [-d <start_date> <start_time> -e <end_date> <end_time>]
Volume detailvmquery -m <media_id>

* bptestbpcd to test client connectivity as from NBU 6.0 and use bpclntcmd to test hostname lookup.
* For NBU 7.0+, All device config for master and media server(s) as well as media and volume catalogs now reside in the EMM database on the master server

1 comment: