The BPDBJOBS_OPTIONS environment variable provides a convenient method to set job retention options with a script. The bpdbjobs process determines how long to retain a job by checking for the BPDBJOBS_OPTIONS environment variable. If present, BPDBJOBS_OPTIONS overrides the registry key settings.
The following options can be used to determine the length of time NetBackup retains jobs.
The options should be entered in lower case in the BPDBJOBS_OPTIONS environmental variable:
-keep_hours hours
Use with the -clean option to specify how many hours bpdbjobs keeps unsuccessfully completed jobs. Default: 78 hours.
To keep both successful and both failed jobs longer than the default of 78 hours, keep_successful_hours must be used with keep_hours
-keep_successful_hours hours
Use with the -clean option to specify how many hours bpdbjobs keeps successfully completed jobs. The number of hours must be less than or equal to keep_hours.
-keep_days days
Use with the -clean option to specify how many days bpdbjobs keeps completed jobs. Default: 3 days.
-keep_successful_days days
Use with the -clean option to specify how many days bpdbjobs keeps successfully completed jobs. Default: 3 days.
A batch file (cleanjobs.bat) was used in the following example. You can copy the script directly from this document and changed as needed.
The first line specifies how long to keep unsuccessful jobs (24 hours) and successful jobs (five hours).
The second line specifies the path to the bpdbjobs command. Indicate the correct location of bpdbjobs in the .bat file. In this example, NetBackup was installed in the default location:
set BPDBJOBS_OPTIONS= -keep_hours 24 -keep_successful_hours 5 C:\progra~1\VERITAS\NetBackup\bin\admincmd\bpdbjobs -clean
You can store the .bat file anywhere, as long as it is run from the appropriate directory.
In the following example, the administrator created and stored cleanjobs.bat in C:\Program Files\VERITAS\NetBackup.