Run bpstart_notify script only for a required policy and/or schedule.

Article: 100021852
Last Published: 2019-06-27
Ratings: 0 0
Product(s): NetBackup

Problem

Run bpstart_notify script only for a required policy and/or schedule.

 

Solution

1. As mentioned in the NetBackup Administrator's Guide Volume II (See  bpstart_notify - UNIX clients), the bpstart_notify script can be named in the following format:

bpstart_notify.<policy_name>.<schedule_name>

Where:
<policy_name> is the required Policy name for which we want to run the script.
<schedule_name> is the scheduled name of the mentioned Policy for which we need to run the script.

The following conditions apply with this type of format:

a. If policy_name and schedule_name is not defined the bpstart_notify will run for all the policies for that client on which the bpstart_notify is created.
b If schedule_name is not specified, the bpstart_notify will run for all the schedules for the policy specified.



2. Another way is to grab from the parameters of bpstart_notify and put a condition in bpstart_notify to make the script to execute for a particular Client name, Policy name, Schedule name or Schedule_type.

e.g. :

<snip>

if [ "$4" = "FULL" ]
then
   <command>   <--- Here mention the code/script/command to be executed, IF the above logic is correct (i.e. if the schedule type is FULL).
fi
</snip>

The above logic will be true if Schedule Type is FULL. The $4 refers to the Schedule type, which is the fourth parameter or argument passed with bpstart_notify script. In the similar way $1 (Client name), $2 (Policy name) and $3 (Schedule_type) can also be used to run bpstart_notify with only when required condition for parameter(s) is true.

P.S.: $4 or the Schedule Type can have following values :
FULL
INCR (differential incremental)
CINC (cumulative incremental)
UBAK (User Backup)
UARC (User Archive)



It can be more clarified like this :

The bpstart_notify script is called by bpbkar process, as read from the bpbkar logs:

<4> bpbkar notify: /usr/openv/netbackup/bin/bpstart_notify <Client_name> <Policy_name> <sched_name> <Schedule_type>

The Client name, Policy name, Schedule name and Schedule_type are the four parameters passed to bpstart_notify script and hence are referred as $1, $2, $3 and $4, respectively.


The second way can be useful where different scripts for different policies and a number of schedules are to be executed on a single client and naming each of the bpstart_notify with <pol_name>.<sched_name> format could be troublesome and unmanageable.
 
We can use the condition statement (using simple Shell-script logic-loops like if, case, while etc.), as mentioned above, and can call the desired custom script in there. This will help us to easily manage the custom scripts by putting them at single place.
 
In the second way mentioned above, the bpstart_notify will be run each time the backup is started (see above the condition a. in 1st method of bpstart_notify script). It will be exited without performing any operation if NONE of the conditions, coded in script, meet TRUE. Therefore, the bpbkar logs may not be able to tell clearly while troubleshooting any bpstart_notify script issue.
 

Note: To use this script, copy the following file from the Master server:

/usr/openv/netbackup/bin/goodies/bpstart_notify

Then place the script in the following location on the UNIX client:

/usr/openv/netbackup/bin/

 

For details about calling custom scripts, refer to the Related Articles section below.

 

 

 

Was this content helpful?