cancel
Showing results for 
Search instead for 
Did you mean: 

need command for NBU

nikenbu
Level 2

Hi ALL,

 

NBU 8.1.2.

I have 1000 clients in the environment.

 

I want to know that what all client dont have full backup ran in past 3 days.

 

I am using below command but it is showing me all clinet names in the file.

 

I need to know the command which can give what all clients do not have the backups in last 3 days.

 

I am using below command currrently.


 for i in `cat client13feb2022.txt`;do echo "Client:$i";./bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l | awk '/^IMAGE/ {print $2, $7, $11}' | egrep -i "week|Full"; done

 

 

9 REPLIES 9

StefanosM
Level 6
Partner    VIP    Accredited Certified

you need to add to awk the $12 column. Which is the schedule type.

OR add to your bpimagelist command the following option

-st sched_type

Specifies a schedule type for the image selection. The default is any schedule type. Valid values are as follows:

FULL (full backup)
INCR (differential-incremental backup)
CINC (cumulative-incremental backup)
UBAK (user backup)
UARC (user archive)
NOT_ARCHIVE (all backups except user archive)

 

https://www.veritas.com/support/en_US/article.100017904

 

 

 

Nicolai
Moderator
Moderator
Partner    VIP   

Hi  @nikenbu 

I guess OpsCentre could also do the job, really depend on, if reporting requirement is a growing issues or just a "one off".

https://www.veritas.com/content/support/en_US/doc/27537447-133302844-0/v46380426-133302844

Hi Stefanos M,

 

[root@admincmd]# for i in `cat client13feb2022.txt`;do echo "Client:$i";./bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL | awk '/^IMAGE/ {print $2, $7, $11}' | egrep -i "week|Full"; done

 

Client:A
no entity was found
Client:B
no entity was found
Client:C
no entity was found
Client:D
D pol1 Weekly_Full
Client:E
E pol2 Weekly_Backup_Full
E Pol3 Weekly_Backup_Full
Client:F
no entity was found

 

 

I need the command which i run ,will give result like:

 

Below clients backup did not run in the mentioned time frame

xy

z

v

g

h

 

 

Thanks

 

Thanks Nicolai.

 

We are not using opscenter because of some management and security reasons.

HI @nikenbu 

Use the return code from bpimagelist to determine whether a client has had the required backup or not. A return code of 0 implies there is something, and return code of 227 means nothing found. 

So something like this

 

echo "Below clients backup did not run in the mentioned time frame:"
for i in `cat clients13feb2022.txt`;do
   bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL >/dev/null 2>&1
   if [ $? -ne 0 ]; then
      echo $i
   fi
done

 

Cheers
David

Or the above on one line:

# echo "Below clients backup did not run in the mentioned time frame"; for i in `cat clients13feb2022.txt`;do bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL >/dev/null 2>&1; if [ $? -ne 0 ]; then echo $i; fi; done

Thanks David.

 

Its giving me the list of clients whose backup did run.

 

I need the list of clients whose backup did not run.

[root@ admincmd]# echo "Below clients backup did not run in the mentioned time frame"; for i in `cat client13feb2022.txt`;do bpimagelist -d 02/10/2022 00:00:00 -e 02/14/2022 00:00:00 -client $i -l -st FULL >/dev/null 2>&1; if [ $? -ne 0 ]; then echo $i; fi; done
Below clients backup did not run in the mentioned time frame
ggnkbkp1

ggnkbkp2

ggnkbkp3

ggnkbkp4

ggnkbkp5

 

Thanks

 

HI @nikenbu 

The command works fine on my system and produces the expected results. Can you compare the output from your previous command and check?

[root@admincmd]# for i in `cat client13feb2022.txt`;do echo "Client:$i";./bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL | awk '/^IMAGE/ {print $2, $7, $11}' | egrep -i "week|Full"; done

David

This is the output from your original and my commands to show what happens on my system:

# for i in `cat clients.txt`;do echo "Client:$i";bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL | awk '/^IMAGE/ {print $2, $7, $11}' | egrep -i "week|Full"; done
Client:client1
no entity was found
Client:client2
client2 Dedupe_Catalog_client2 Full
client2 NBU-catalog Full
client2 NBU-catalog Full
Client:client3
client3 Dedupe_Catalog_client3 Full
Client:client4
no entity was found

# echo "Below clients backup did not run in the mentioned time frame"; for i in `cat clients.txt`;do bpimagelist -d 02/10/2022 00:00:00 -e 02/13/2022 00:00:00 -client $i -l -st FULL >/dev/null 2>&1; if [ $? -ne 0 ]; then echo $i; fi; done
Below clients backup did not run in the mentioned time frame
client1
client4