bpdbjobs

bpdbjobs — interact with NetBackup jobs database

SYNOPSIS

<admin_dir_path>bpdbjobs [-report] [-M master_servers] [-ignore_parent_jobs] [ -vault | -lvault | -all_columns | -most_columns | -gdm ] [-file pathname] [-append] [-noheader] [-mastertime] [-jobid job1,job2,...jobn] [verbose]

<admin_dir_path>bpdbjobs -summary [-M master_servers] [-ignore_parent_jobs] [ -U | -L | -all_columns ] [-file pathname] [-append] [verbose]

<admin_dir_path>bpdbjobs -resume | -suspend | -delete | -cancel | -restart job1,job2,...jobn | type=jobtype | type=all [-M master_servers] [-quiet]

<admin_dir_path>bpdbjobs -cancel_all [-M master_servers]

<admin_dir_path>bpdbjobs -clean [-M master_servers] [ -keep_hours hours | -keep_days days ] [ -keep_successful_hours hours | -keep_successful_days days ] [verbose]

<admin_dir_path>bpdbjobs -version

<admin_dir_path>bpdbjobs -change_priority_by [-M master_servers] -priority number -jobid job1,job2,...jobn

<admin_dir_path>bpdbjobs -set_priority [-M master_servers] -priority number -jobid job1,job2,...jobn

On Windows systems, <admin_dir_path> is <install_path>\NetBackup\bin\admincmd\

DESCRIPTION

bpdbjobs interacts with the jobs database and is useful in scripts or as a command-line administration tool. It prints the entire jobs database, prints a summary of the database, deletes done jobs, cancels incompleted jobs, and cleans old jobs.

To customize the output of bpdbjobs, add column definition entries (BPDBJOBS_COLDEFS) in the bp.conf file.

Refer to the NetBackup Administrator's Guide for UNIX and Linux, Volume II for more information about the following: the bp.conf file, a complete list of the definitions, and the BPDBJOBS_COLDEFS entries.

The -cancel, -delete, -jobid, -resume, and -suspend options all use the jobtype as a suboption. Enter one of the following as jobtype. (Letters following the capitalized letters are ignored.)

 ALL | *
  REStore
  BACkup
  ARChive
  VERify
  DUPlicate
  IMPort
  LABel
  ERAse
  VAUlt
  TPReq
  CLEan
  FORmat
  INVentory
  QUAlification
  DBbackup | CATalogbackup

OPTIONS

-all_columns

Displays all columns of a report or summary. Some of the more useful fields of this command are:

field2 = jobtype

0=backup, 1=archive, 2=restore, 3=verify, 4=duplicate, 5=import, 6=catalog backup, 7=vault, 8=label, 9=erase, 10=tape request, 11=tape clean, 12=format tape, 13=physical inventory, 14=qualification, 15=database recovery, 16=media contents, 17=image delete, 18=LiveUpdate

field3 = state

0=queued, 1=active, 2=wait for retry, 3=done, 4=suspended, 5=incomplete

field5 = policy

The policy that this job is associated with.

field6 = schedule

The schedule that this job is associated with.

field14 = operation

0=mount

1=position

2=connect

3=write

4=vault initialize

5=vault duplication

6=vault duplication complete

7=vault catalog backup

8=vault eject and report

9=vault complete

10=report

11=duplicate

12=import

13=verify

14=restore

15=catalog-backup

16=vault

17=label

18=erase

field21 = subtype

0=immediate, 1=scheduled, 2=user-initiated, 3=quick erase, 4=long erase, 5=database backup staging, 6=database backup cold

field23 = schedule_type

0=full, 1=incr, 2=user backup, 3=user archive, 4=cumulative-incr

field24 = priority

Priority that is assigned to this job as configured in the policy attributes.

The output of this command consists of a single line per backup job. Each line of the output is a comma-delimited list in the following format:

jobid,jobtype,state,status,policy,schedule,client,server
,started,elapsed,ended,stunit,try,operation,kbytes,files
,pathlastwritten,percent,jobpid,owner,subtype,classtype,
schedule_type,priority,group,masterserver,retentionunits
,retentionperiod,compression,kbyteslastwritten,fileslast
written,filelistcount,[files],trycount,[trypid,trystunit,
tryserver,trystarted,tryelapsed,tryended,trystatus,trys
tatusdescription,trystatuscount,[trystatuslines],trybyte
swritten,tryfileswritten],parentjob,kbpersec,copy,robot,
vault,profile,session,ejecttapes,srcstunit,srcserver,src
media,dstmedia,stream,suspendable,resumable,restartable,
datamovement,snapshot,backupid,killable,controllinghost

The following is an example:

* 415,Backup,Done,96,jvlcc,vlcdiff,mule,buffalo,0885942000,0000000014,
0885942014,8mm,3,,,,,,11602,root,1,0,1,10,,buffalo,2,1,0,0,0,3,/home/vlc/
jadm_JAVA/usr/openv/java,/home/vlc/directory with spaces,/home/vlc/test,
3, 11544,8mm,buffalo,885941970,13,885941983,96,unable to allocate new 
media for backup\, storage unit has none available,2,01/27/98 16:59:30 
- connecting, 01/27/98 16:59:30 - connected;connect time: 000:00:00,0,0,
11573,8mm,buffalo,885941986,11,885941997,96,unable to allocate new media 
for backup\, storage unit has none available,2,01/27/98 16:59:40 - 
connecting,01/27/98 16:59:40 - connected; connect time: 000:00:00,0,0,
11602,8mm,buffalo,885942000,14, 885942014,96,unable to allocate new media 
for backup\, storage unit has none available,2,01/27/98 17:00:00 - 
connecting,01/27/98 17:00:00 - connected; connect time: 000:00:00,0,0

Refer to Example 1 for an example on how to interpret the -all_columns output.

-append

Appends the output to the file that the -file option specifies. If no -file option is provided, the output goes to stdout.

-cancel job1,job2,...jobn |type=jobtype|type=all

Causes bpdbjobs to cancel active jobs cleanly that appear with a Status 150 in the Activity Monitor. For example:

bpdbjobs -cancel 11328
bpdbjobs -cancel 11328,11329,11330

Possible jobtype values are listed in the Description section.

-cancel_all

Causes bpdbjobs to cleanly cancel all incomplete jobs that appear with a Status 150 in the Activity Monitor. For example:

bpdbjobs -cancel_all
-change_priority_by [-M master_servers] -priority number -jobid job1,job2,...jobn

Changes the priority of the specified job or jobs.

-clean

Causes bpdbjobs to delete the completed jobs that are older than a specified time period. Use with the -keep_hours or -keep_days, or -keep_successful_hours or -keep_successful_days parameters to specify a retention period. For example:

bpdbjobs -clean -keep_hours 30
-delete job1,job2,...jobn |type=jobtype|type=all

Deletes the completed jobs that appear in the Activity Monitor. Multiple job IDs can be deleted in one command. For example:

bpdbjobs -delete 11328,11329,11330

This option deletes one of the following:

  • The jobs that job1,job2,...jobn specify

  • All the eligible jobs that jobtype indicates

  • All eligible jobs if type=all is specified

Possible jobtype values are listed in the Description section.

-file pathname

Names a file to which the output of bpdbjobs is written. If no -file option is provided, the output goes to stdout.

-gdm

Displays less of the information in a report than -most_columns.

-ignore_parent_jobs

Ignores the parent jobs for the -report and -summary options.

-jobid job1,job2,...jobn |type=jobtype|type=all

Reports on multiple job IDs.

Possible jobtype values are listed in the Description section.

-keep_days days

Used with the -clean option to specify how many days bpdbjobs keeps completed jobs. Default is three (3) days.

-keep_hours hours

Used with the -clean option to specify how many hours bpdbjobs keeps completed jobs. Default is 72 hours.

-keep_successful_days days

Used with the -clean option to specify how many days bpdbjobs keeps successful completed jobs. Default is three (3) days.

This value must be less than the -keep_days value.

-keep_successful_hours hours

Used with the -clean option to specify how many hours bpdbjobs keeps successful completed jobs. Default is 72 hours.

This value must be less than the -keep_hours value.

-L

Reports in long format.

-lvault

Displays the additional columns specific to Vault jobs.

-M master_servers

Applies to an environment with multiple master servers. Use the -M option to summarize jobs, delete jobid(s), cancel jobid(s), and cancel all active job IDs for a specific master server:

-mastertime

By default, bpdbjobs translates the start or the end times to be relative to the local clock. A job that starts 10 minutes ago looks like it starts 10 minutes ago regardless of time zone and clock differences with the master server. This option, however, circumvents that translation so that time values are consistent between admin clients.

-most_columns

Behaves similarly to -all_columns but does not print the file list or any information on previous attempts. The -most_columns option is significantly faster than -all_columns.

-noheader

Prevents the header from being printed in the report.

-quiet

Cancels the reporting of the number of jobs resumed/suspended/deleted/canceled.

-report

Provides a report of data that is stored in the Activity Monitor. If no option is specified with bpdbjobs, -report is the default option.

-restart job1,job2,...jobn |type=jobtype|type=all

Cleanly restarts a job that jobtype indicates. This option supports backups and enables you to restart a job by typing the word BACkup in the Activity Monitor.

-resume job1,job2,...jobn |type=jobtype|type=all

Resumes the jobs that job1,job2,...jobn specify, all eligible checkpoint backups or restore the jobs that jobtype indicates, or all eligible jobs if type=all is specified.

Possible jobtype values are listed in the Description section.

-set_priority [-M master_servers] -priority number -jobid job1,job2,...jobn

Sets the priority of the specified job or jobs to the specified priority number.

-summary [-U | -L | -all_columns]

Prints a summary line to stdout for all the jobs that are stored in NBU/jobs. Parameters -U and -L format the output of the command. Use the -file option to write the output to a given directory or file name. For example:

bpdbjobs -summary -U -file /tmp/summary.out
-suspend job1,job2,...jobn |type=jobtype|type=all

Suspends the jobs that job1,job2,...jobn specifies or all eligible checkpoint backups or restore the jobs that jobtype indicates, or all eligible jobs if type=all is specified.

Possible jobtype values are listed in the Description section.

-U

Reports in user format. NetBackup report-generating tools such as the NetBackup-Java Reports application uses this report format.

-vault

Displays the additional columns specific to Vault jobs.

-verbose

Causes bpdbjobs to log additional information in the debug log in the following directory, if the directory exists:

On Windows systems: install_path\NetBackup\logs\bpdbjobs\*

-version

Prints the version string, then halts. Any other switches are ignored.

EXAMPLES

This example shows the following: sample logic to decode -all_columns output to produce the backup initiation time of a job that succeeded, but not on the first try.

Field 9 = start time (The time the job was first queued.)

This time is of little value unless you want to know when the job was queued.

Up to Field 32, all fields are fixed. Then Field 32 tells you how many entries are in the filelist fields.

Field 32 = filelistcount (The number of files that are listed in the filelist.)

Add that value to 33 to determine the field that shows the number of tries:

Field 33 + filelistcount = trycount (The number of tries that occurred.)

If there is only one try, calculate the following to determine its start time:

Field 33 + filelistcount + 4 = [first]trystarted (The start time of the first try.)

If there are two tries, go past the status entries. First, calculate the number of entries in the status field:

Field 33 + filelistcount + 9 = trystatuscount (The number of status entries in the first try.)

Then, to get the start time of the second try, calculate the following:

Field 33 + filelistcount + 9 + trystatuscount + 6 = [second] trystarted