cancel
Showing results for 
Search instead for 
Did you mean: 

A script to show # of backup attempts

Monda
Level 3

I picked up this handy little command recently to print out backup failures for the last 24 hours:

 

bperror -backstat -U | awk '($1 > 1) {print $0}'

 

is there any way to take the 2nd and subsequent attempts in to account as in the large amount of cases when I check the activity monitor to troubleshoot i find that the job was successful?

(Or to display the number of attempts in the output)

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6

You could always run the command again for each of your 'failed' clients but without the filter for status code:

 

bperror -backstat -U -client client_name

 

This would then give you all the backups (successful & failed) for that particular client.

 

***Edit***

Altho' you cannot differentiate between different streams (e.g. C:, D:, etc etc) so you couldn't specifically say from this which stream was successful, which one failed, restarted & was then successful or just failed outright.

***End of Edit***

 

You may also be able to utilise the list by stat_code first:

 

bperror -backstat -U -by_statcode

Message Edited by Andy Welburn on 01-20-2009 03:51 PM

View solution in original post

4 REPLIES 4

Andy_Welburn
Level 6

You could always run the command again for each of your 'failed' clients but without the filter for status code:

 

bperror -backstat -U -client client_name

 

This would then give you all the backups (successful & failed) for that particular client.

 

***Edit***

Altho' you cannot differentiate between different streams (e.g. C:, D:, etc etc) so you couldn't specifically say from this which stream was successful, which one failed, restarted & was then successful or just failed outright.

***End of Edit***

 

You may also be able to utilise the list by stat_code first:

 

bperror -backstat -U -by_statcode

Message Edited by Andy Welburn on 01-20-2009 03:51 PM

Monda
Level 3

Thanks Andy

 

I was kind of hoping for something simpler but I guess i can script that. I'll try and remember to post here when i've done it.

 

Ray

Stumpr2
Level 6

If you are looking for the number of attempts (retries) then bperror will not give you that information.

try bpdbjobs

 

Andy_Welburn
Level 6

Just a bit more for you to look at (may give you some ideas if nothing else):

 

Find your failed clients as above.

 

Determine the job ids for this client (there may well be duplicates here as it retries):

bperror -backstat -client client | cut -d " " -f6

 

Then run the following for each job id:

bperror -backstat  -U -jobid job_id

 

So you can see whether a job restarted & failed or succeeded (hopefully!)

 

Well you said you were going to script something, so ... Smiley Wink