Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is the command to determine if backup completed successfully

Status
Not open for further replies.

d3h614

MIS
Aug 6, 2002
24
US
I need a one line script that determines if a backup group has completed successfully or failed.
If the group completes successfully, I want to create a file so that our scheduler sees it and releases a script that unmounts and removes our snapshot volumes. I haven't used nsradmin much and am having a really hard time finding this one command. Please help. Thank you.
 
This is not so easy.

You may change the action of a notification to create a file. However, this is written at the end of each automatic backup - succeeded or failed. However, i am pretty sure that the command will exit with return code 0 upon success.
 
2 ways to do that:

- If you use the internal Networker scheduler, you can analyse the result of the nsradmin request, but it's more difficult:

show status;completion;last start
print name:MYGROUP; type:NSR group
quit

- The best way for me is that the scheduler itself submit the savegrp command, and then you test the resulting errorlevel
 
I use this way:

grep -q -E 'failed|changed' /nsr/tmp/sec/sg/<GroupName>/*

You can try to do

echo $?

to verify the result of such a group.

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top