Hi
I am executing database backup via shell script (Korn). The backup log is long, but I would like to capture only the last line so I can send an email if it fails
Example of failed backup (only last 3 lines)
BR0056I End of database backup: bejbofoh.aff 2012-07-26 07.31.21
BR0280I BRBACKUP time stamp: 2010-12-26 07.31.21
BR0054I BRBACKUP terminated with errors
Example of successful backup (only last 3 lines)
BR0056I End of database backup: bejckxdr.anf 2012-07-30 22.32.56
BR0280I BRBACKUP time stamp: 2008-01-30 22.32.56
BR0052I BRBACKUP completed successfully
Hi
Thanks a lot for your help; using "echo $?" did half the job, which is capturing the return code. Is there a way to capture the last line from the backup log witout going to the log file?
Thanks again. My question is: when I run backup via shell script where I use the following command
brbackup -c -p profile
I get an output file, where somewhere there is a log file name
BR0280I BRBACKUP time stamp: 2012-08-01 08.14.30
BR0057I Backup of database: XXX
BR0058I BRBACKUP action ID: bejcrwgf
BR0059I BRBACKUP function ID: anf
BR0056I End of database backup: bejcrwgf.anf 2012-08-01 08.24.42
BR0280I BRBACKUP time stamp: 2012-08-01 08.24.43
BR0052I BRBACKUP completed successfully
I need to either capture the log file name or, even better, capture only the last line without going to the log file. How do I create a variable and do that?