The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to Check for Unix/Linux Passwords lucknowm Shell Programming and Scripting 1 05-29-2008 09:08 PM
Automating UNIX backups? de049 UNIX for Dummies Questions & Answers 3 10-31-2007 11:15 AM
check in unix shell script so that no one is able to run the script manually adi_bang76 Shell Programming and Scripting 1 11-16-2006 10:43 AM
Need a script to do daily backups JPigford UNIX for Dummies Questions & Answers 10 01-18-2005 09:54 PM
UNIX backups saood UNIX for Advanced & Expert Users 4 08-12-2002 07:57 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-25-2009
anjum.suri anjum.suri is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 8
UNIX script to check archivelog backups

Hi All

I am very new to programming/scripting so need some help from UNIX gurus; I need to write a script that check if the archivelog backup went successful or failed; I have written below script that goes to the directory where rman log files for archivelog backups resides and grab "Exit Status" from the archivelog from those files...now I am stuck with the IF part of the script (which I have commented) as in I want to print backup either succeded or failed based on the exit status...From the output I also want to remove those directories which doesn't have backup files

Could anyone please advice?


Script
------

Code:
chkbck ()
{
for i in `ls /ora/rman/logs/`;
do
        ls -latr /ora/rman/logs/$i/b* | tail -1 | nawk '{ print $9 }';
done
}
for i in `chkbck`;
do
        print $i
        grep Exit $i
done > $TMP_FILE

#if egrep -i 'exit status [^0]' $TMP_FILE
 #print "Backup Failed"
#fi

OUTPUT
--------

/ora/rman/scripts> bk2.sh
/ora/rman/logs/BENMU1D/b*: No such file or directory
/ora/rman/logs/BENMU2DD/b*: No such file or directory
/ora/rman/logs/CASEX1T/b*: No such file or directory
/ora/rman/logs/DBADB3D/b*: No such file or directory
/ora/rman/logs/DBATM1T/b*: No such file or directory
/ora/rman/logs/JMATT1T/b*: No such file or directory


/ora/rman/scripts> cat chkbackup.tmp
/ora/rman/logs/DBADB1D/backup_DBADB1D_24Mar09-20:29:28.log
Exit Status 0
/ora/rman/logs/DBADB1P/backup_DBADB1P_24Mar09-19:41:48.log
Exit Status 0
/ora/rman/logs/DBADB2D/backup_DBADB2D_24Mar09-20:16:40.log
Exit Status 0
/ora/rman/logs/DBADB4D/backup_DBADB4D_05Jan09-16:09:39.log
Exit Status 0
/ora/rman/logs/DBADB7D/backup_DBADB7D_24Mar09-19:41:33.log
Exit Status 1
/ora/rman/logs/NO_SID/backup_arch_NO_SID_05Jan09-15:49:15.log
Exit Status 127
/ora/rman/logs/ORADB1P/backup_arch_ORADB1P_04Sep07-07:42:22.log
Exit Status 0
/ora/rman/logs/PAULTST/backup_PAULTST_19Jan09-23:53:03.log
Exit Status 1
/ora/rman/logs/PJ10G1D/backup_PJ10G1D_24Mar09-19:41:14.log
Exit Status 1
/ora/rman/logs/REMDY1X/backup_REMDY1X_04Dec08-22:04:41.log
Exit Status 1

Last edited by Yogesh Sawant; 03-26-2009 at 02:32 AM.. Reason: added code tags
  #2 (permalink)  
Old 03-25-2009
choogendyk choogendyk is offline
Registered User
  
 

Join Date: Jan 2009
Location: Massachusetts
Posts: 41
Doesn't RMAN have its own reporting facility?

You probably have to pay an arm and a leg for training, but maybe someone at your site has been through it? Or maybe you have some manuals? Does it have man pages? Try a man on list, report or show.

Ooh, cool. I actually found someone who had posted some documentation: Querying the RMAN Repository
Closed Thread

Bookmarks

Tags
archive log files, archivelog backups

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0