![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UNIX script to check archivelog backups | anjum.suri | UNIX for Dummies Questions & Answers | 1 | 03-25-2009 07:58 PM |
| IP Monitoring Script | akhtar.bhat | Shell Programming and Scripting | 1 | 02-02-2009 05:03 AM |
| Monitoring Script | manoj.solaris | SUN Solaris | 4 | 07-27-2007 09:27 AM |
| monitoring script | gfhgfnhhn | UNIX for Advanced & Expert Users | 1 | 07-14-2006 01:10 PM |
| Job monitoring script | Love | High Level Programming | 1 | 06-13-2006 10:56 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Archivelog monitoring Script
Could anyone please help? I have written a small program that's actually working fine for me and extracting all the details I required. What code does is, it goes to all archivelog directories and see if archivelog backup was failed or successful Code:
<<CODE>>
TMP_FILE='/ora/rman/scripts/tmp_chk.log'
chkbck ()
{
for i in `ls /ora/rman/logs/`;
do
find /ora/rman/logs/$i/backup_a*.log -mtime -1 2>/dev/null
done
}
for i in `chkbck`;
do
print $i | cut -d"_" -f3
print $i | cut -d"/" -f6
egrep -i 'Starting backup*' $i
egrep -i 'Finished backup*' $i
if egrep -i 'exit status [^0]' $i
then
print "Backup Failed"
else
print "Backup Successful"
fi
done > $TMP_FILE
<<CURRENT OUTPUT>> ABC backup_arch_ABC_22Apr09-155751.log Starting backup at 22-APR-2009 15:57:58 Finished backup at 22-APR-2009 15:59:15 Backup Successful XYZ backup_arch_XYZ_22Apr09-160303.log Starting backup at 22-APR-2009 16:03:15 Finished backup at 22-APR-2009 16:04:44 Backup Successful Now, what I need is if I get this output in a email with proper headings and formatting. <<DESIRED OUTPUT IN EMAIL>> Database FileName Backup Start Backup End Status --------- --------- ------------- ----------- ------- ABC backup_arch_ABC_22Apr09-155751.log 22-APR-2009 15:57:58 22-APR-2009 15:59:15 Backup Successful XYZ backup_arch_XYZ_22Apr09-160303.log 22-APR-2009 16:03:15 22-APR-2009 16:04:44 Backup Successful Could anyone please help me nicely formatting it? |
|
||||
|
Double post with some adjustments.
Continu here for the latest post: Archivelog monitoring Script BTW just click on the Edit button of the post to make adjustments in your post. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|