刚开始接触netbackup的时候,一直使用jnbSA图形界面管理、监控NETBACKUP。今天发现和jnbSA功能相近的命令行工具:bpadm。
有些时候由于网络条件限制,无法启动远端图形界面,这个时候命令行工具就显得尤为重要了。
简单看一下bpadm的功能:
# bpadm
NetBackup Server: backup
NetBackup Administration
------------------------
s) Storage Unit Management...
t) Storage Unit Group Management...
p) Policy Management...
g) Global Configuration...
r) Reports...
m) Manual Backups...
x) Special Actions...
u) User Backup/Restore...
e) Media Management...
h) Help
q) Quit
ENTER CHOICE:
从这里看的处理,基本上jnbSA的功能在bpadm中都包括了,命令行唯一比较差的是缺少实时监控的功能。
不过通过Reports命令也可以实现其中部分功能:
Server: ALL
Client: ALL
Start Date: 05/11/ 23:29:11
End Date: 05/12/ 23:59:59
Output Destination: SCREEN
Reports
-------
b) Backup Status
l) List Client Backups
p) Problems
a) All Log Entries
m) Media...
d) Change Dates
c) Change Client
s) Change Server
o) Output Destination (SCREEN or FILE)
h) Help
q) Quit Menu
ENTER CHOICE:
Backup Status包含了最近完成的备份情况,而List Client Backups包括的信息会更详细一些。不过这两个报告无法看到正确运行的情况。
通过All Log Entries可以看到详细的后台操作信息,比如netbackup的备份开始、结束等等。检查日志可以在某种程度上实现目标实时监控的功能。
下面是Backup Status、List Client Backups和All Log Entries的报告片断:
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 backup testoracle Default-Ap backup 05/12/ 00:40:27
0 backup testoracle Default-Ap backup 05/12/ 00:41:54
0 backup testoracle Default-Ap backup 05/12/ 00:45:56
0 backup testoracle Default-Ap backup 05/12/ 00:47:20
0 racnode1 installagent Default-Ap backup 05/12/ 00:56:10
0 racnode1 installagent Default-Ap backup 05/12/ 00:57:34
(B)ack (F)orward (U)p (D)own (Q)uit
Client: backup
Backup ID: backup_1178901997
Policy: testoracle
Policy Type: Oracle
Sched Label: Default-Application-Backup
Schedule Type: User Backup (Backup Policy)
Retention Level: infinity (9)
Backup Time: 05/12/ 00:46:37
Elapsed Time: 000:00:43
Expiration Time: INFINITY
Compressed: no
Encrypted: no
Kilobytes: 7200
Number of Files: 1
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: test
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: no
TIR Available: no
Backup Copy: Standard (0)
Client: backup
Backup ID: backup_1178901869
Policy: testoracle
Policy Type: Oracle
Sched Label: Default-Application-Backup
Schedule Type: User Backup (Backup Policy)
Retention Level: infinity (9)
Backup Time: 05/12/ 00:44:29
Elapsed Time: 000:01:26
Expiration Time: INFINITY
Compressed: no
Encrypted: no
Kilobytes: 522272
Number of Files: 1
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: test
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 111
(B)ack (F)orward (U)p (D)own (Q)uit
TIME SERVER/CLIENT TEXT
05/12/ 00:36:13 backup - INITIATING bpdbm: NetBackup 6.0 110304 on backup IDIRSTRUCT=2 (VERBOSE = 0)
05/12/ 00:36:15 backup - INITIATING bpjobd: NetBackup 6.0 on backup
05/12/ 00:36:20 backup - INITIATING bprd: NetBackup 6.0 110304 on backup
05/12/ 00:36:33 backup - [3] backup of client backup, policy testoracle, is suspended: exceeded configured number of tries for
a schedule
05/12/ 00:37:09 backup backup client backup handling path /0pihgb9h_1_1
05/12/ 00:37:09 backup - running session_start_notify
05/12/ 00:37:09 backup - started backup job (jobid=918) for client backup, policy testoracle, schedule
Default-Application-Backup
05/12/ 00:37:10 backup backup starting backup job (jobid=918)
05/12/ 00:40:05 backup backup begin writing backup id backup_1178901430, copy 1, fragment 1, to media id BBT247 on drive index
0
05/12/ 00:40:26 backup backup successfully wrote backup id backup_1178901430, copy 1, fragment 1, 288 Kbytes at 25.575
Kbytes/sec
05/12/ 00:40:27 backup backup CLIENT backup POLICY testoracle SCHED Default-Application-Backup EXIT STATUS 0 (the requested
operation was successfully completed)
05/12/ 00:40:28 backup - database backup is currently disabled
05/12/ 00:40:28 backup - running session_notify
05/12/ 00:40:28 backup - cleaning image DB
05/12/ 00:40:29 backup - Cleanup running in background, pid=622
05/12/ 00:40:29 backup - Deleting Expired Images
05/12/ 00:40:29 backup - cleaning media DB(s)
05/12/ 00:40:29 backup - deleted 0 expired records, compressed 0, tir removed 0, indexed 0, deleted 0 expired copies
05/12/ 00:41:10 backup backup client backup handling path /c-1920405094-0512-00
05/12/ 00:41:10 backup - running session_start_notify
05/12/ 00:41:11 backup - started backup job (jobid=919) for client backup, policy testoracle, schedule
Default-Application-Backup
05/12/ 00:41:11 backup backup starting backup job (jobid=919)
05/12/ 00:41:29 backup backup begin writing backup id backup_1178901671, copy 1, fragment 1, to media id BBT247 on drive index
0
05/12/ 00:41:53 backup backup successfully wrote backup id backup_1178901671, copy 1, fragment 1, 7200 Kbytes at 499.792
Kbytes/sec
05/12/ 00:41:54 backup backup CLIENT backup POLICY testoracle SCHED Default-Application-Backup EXIT STATUS 0 (the requested
operation was successfully completed)
05/12/ 00:41:55 backup - database backup is currently disabled
05/12/ 00:41:55 backup - running session_notify
05/12/ 00:41:55 backup - cleaning image DB
05/12/ 00:41:56 backup - Cleanup running in background, pid=3050
05/12/ 00:41:56 backup - Deleting Expired Images
05/12/ 00:41:56 backup - cleaning media DB(s)
05/12/ 00:41:56 backup - deleted 0 expired records, compressed 0, tir removed 0, indexed 0, deleted 0 expired copies
05/12/ 00:44:29 backup backup client backup handling path /0uihgbn8_1_1
05/12/ 00:44:29 backup - running session_start_notify
05/12/ 00:44:29 backup - started backup job (jobid=920) for client backup, policy testoracle, schedule
Default-Application-Backup
05/12/ 00:44:29 backup backup starting backup job (jobid=920)
(B)ack (F)orward (U)p (D)own (Q)uit