cancel
Showing results for 
Search instead for 
Did you mean: 

Command bpplclients to delete not working in script

X2
Moderator
Moderator
   VIP   

I'm creating a script to automatically "refresh" the clients in a policy. The policy has no schedule as it is only there for audit purposes and probing the client for connectivity.

The script (in BASH) is working but for one operation: deleting all clients in the policies.

The delete operation (bpplclients Backup_policy_name -delete <client names>) is setup to issue delete for 20 clients at a time - as per the command reference guide (NetBackup 771). However, when I run the script for the delete operation, the clients remain in the policy!

Running the same command manually (20 clients) works fine.

Am I missing something? Has anyone attempted this earlier (quite likely)?

PS: if there are more than 20 clients in a policy, the command waits for a few seconds before removing the next batch.

7 REPLIES 7

sdo
Moderator
Moderator
Partner    VIP    Certified

What return status code do you get when the command is run from the script?

X2
Moderator
Moderator
   VIP   

Using -v with bpplclients gives me EXIT status = 0 (from NetBackup) and the BASH script shows me exit code 0 too.

At the moment I'm running the script to delete only 1 client at a time. To avoid any path or environment issues, the command used in the script uses full path.

X2
Moderator
Moderator
   VIP   

Also, when run with the -v option, the bpplclients command logs the following and deletion of client from policy is unsuccessful.

17:01:17.414 [31582] <2> bpplclients: INITIATING: version NetBackup 7.7.3 created: 2016051915
17:01:17.414 [31582] <2> logparams: VMWARE-Policy-Name -delete host.FQDN
17:01:17.428 [31582] <2> LOCAL CLASS_ATT_DEFS: Product ID = 6
17:01:17.432 [31582] <2> read_schedlist_x: /usr/openv/netbackup/db/class/VMWARE-Policy-Name/schedule is empty or not accessible, No such file or directory (2)
17:01:17.432 [31582] <2> bpplclients: EXIT status = 0
17:01:18.465 [31586] <2> bpplclients: VERBOSE = 0

When running the command from shell to delete the host manually, the log is as under:

17:04:39.289 [31806] <2> bpplclients: VERBOSE = 0
17:04:39.289 [31806] <2> bpplclients: INITIATING: version NetBackup 7.7.3 created: 2016051915
17:04:39.289 [31806] <2> logparams: VMWARE-Policy-Name -delete host.FQDN
17:04:39.302 [31806] <2> LOCAL CLASS_ATT_DEFS: Product ID = 6
17:04:39.306 [31806] <2> read_schedlist_x: /usr/openv/netbackup/db/class/VMWARE-Policy-Name/schedule is empty or not accessible, No such file or directory (2)
17:04:39.306 [31806] <8> vnet_get_user_credential_path: [vnet_vxss.c:1474] status 35 0x23
17:04:39.306 [31806] <8> vnet_check_user_certificate: [vnet_vxss_helper.c:3728] vnet_get_user_credential_path failed 35 0x23
17:04:39.306 [31806] <2> ConnectionCache::connectAndCache: Acquiring new connection for host masterServer.FQDN, query type 189
17:04:39.308 [31806] <2> vnet_pbxConnect: pbxConnectEx Succeeded
17:04:39.308 [31806] <2> logconnections: BPDBM CONNECT FROM masterServerIP.14401 TO masterServerIP.1556 fd = 4
17:04:39.313 [31806] <4> TZ: Send Timezone offset=18000
17:04:39.313 [31806] <2> db_end: Need to collect reply
17:04:39.412 [31806] <2> bpplclients: EXIT status = 0

Command is run as root and is successful in deleting the host from the policy.

Does that indicate an issue to a trained eye?

sdo
Moderator
Moderator
Partner    VIP    Certified

Time to log a support call.

Sounds like you've found a bug.

(Is there a badge for that?)

X2
Moderator
Moderator
   VIP   

I wonder if support will help me with the issue because the command does work with 20 clients if run independently in a shell session.

I haven't been able to test it in the last day or so due to other work but I intend to run the script and do a bit of debugging to see what the script's state is when it reaches the command.

PS: I also have a function which adds the new list of clients. It works fine (one client added at a time - in a loop).

X2
Moderator
Moderator
   VIP   

Update

I have setup script logging and -xv flags in bash when running the script. Nothing came out any different to indicate that the command was causing any kind of warnings/errors.

I also checked my environment variables without the script and also withing the script. No significant different that can cause change in behaviour.

However, I'm inclined to believe that it happens only when my script runs. That is because if I have a list of client names for a policy in a text file and I run a script (BASH) which goes through the client names and deletes them one-by-one, the results are as expected: all clients are removed from the policy.

..... the search continues.

X2
Moderator
Moderator
   VIP   

Long due update:

I think I have narrowed down the issue to the syntax used in my script. It came to my mind while working on a completely different script (not in the shower though!).

I will update after verifying with correct syntax.