cancel
Showing results for 
Search instead for 
Did you mean: 

I want BPEND fails

guigsounet
Not applicable

Hello,

I use bpstart/end for some of my backups, my problem is : even when there's an error on my bpend, the errorcode for he backup is 0

I tried this for my tests : 

 

echo KO >> ficlog.txt

find KO ficlog.txt

if %errorlevel% EQU 0 then

echo 900 > %6

when i put this code in bpstart : my backup fails immediatly with error code 73 (and a file is created ine the bin directory with 900 inside)

when i put the same code in my bpend, the backup do its job (and it s totaly normal) but the errorcode is 0

I tried %5 but dont work better.

 

He point is that i need to be able to see through the activity monitor if there was a pb on bpstart/end, in his example, i need to see if one of my services didnt start correcltly at the end of the backup

 

I also tried :

echo KO >> ficlog.txt

find KO ficlog.txt

if %errorlevel% EQU 0 then

exit 900

Why 900 ? just a random number 

 

So , is there a way to make the backup exit with an errorcode > 1 when something fails in the bp_end

I m under netbackup 6.5

 

1 ACCEPTED SOLUTION

Accepted Solutions

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

I think you may have misunderstood the logic behind bpstart and bpend scripts...

bpstart must complete successfully before bpbkar will be started on the client.

Once the backup has completed (success or fail) bpend will be called.

The backup has already completed - exit status of bpend makes no difference to the status of the backup.

bpend_notify can merely report %5 (Status of the backup), not determine the status.

View solution in original post

2 REPLIES 2

CRZ
Level 6
Employee Accredited Certified

I'm a UNIX guy, so I Googled it :) and came up with this thread from Stack Overflow which indicates maybe you need a different syntax in your "if" statement ("if errorlevel 1" maybe?)

How do I get the application exit code from a Windows command line?
 http://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-comm...

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

I think you may have misunderstood the logic behind bpstart and bpend scripts...

bpstart must complete successfully before bpbkar will be started on the client.

Once the backup has completed (success or fail) bpend will be called.

The backup has already completed - exit status of bpend makes no difference to the status of the backup.

bpend_notify can merely report %5 (Status of the backup), not determine the status.