• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Netbackup Script to get Policy Vs client list

By admin

Here is a small script to get the list of clients configured against a list of policies in netbackup. Command used here is bpplclients to get the client list.

Put the list of policy in a file /tmp/policy_list.

# cat /tmp/policy_list
policy01
policy02
policy03

The script :

for i in `cat /tmp/policy_list`
do
    bpplclients $i -noheader | awk 'BEGIN {printf "'$i'"}{print "," $NF}'
done > /tmp/output.csv

Below is the Output file [ comma (,) separated ]

policy01,client01
,client02
policy02,client01
policy03,client01

The output CSV file should look like below :

Policy Name Clients
policy01 client01
  client02
policy02 client01
policy03 client01

Output in

In the output shown above, Policy name is printed only once for multiple clients. To get the CSV file in the format where backup policy is printed on each line for every client, Use the below script :

for i in `cat /tmp/policy_list`
do
    bpplclients $i -noheader | awk '{printf "'$i'" "," $NF}'
done > /tmp/output.csv

Below is the Output file [ comma (,) separated ]

policy01,client01
policy01,client02
policy02,client01
policy03,client01

The output CSV file should look like below :

Policy Name Clients
policy01 client01
policy01 client02
policy02 client01
policy03 client01

Filed Under: Netbackup

Some more articles you might also be interested in …

  1. Netbackup Script to get client Vs policy list

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary