Sponsored Content
Full Discussion: please help on this
Top Forums Shell Programming and Scripting please help on this Post 302216755 by adzuanamir on Monday 21st of July 2008 05:59:31 AM
Old 07-21-2008
please help on this

Hi
Previously i've asked in this forum but i cant solve this
This is the contents of file name rman_status.ksh:

sqlplus "/as sysdba" @rman_error.sql > rman_error.txt
mailx -r oraadm@juwpkl.gov.my -c adzuan@nc.com.my -s "RMAN Error" adzuan@nc.com.my < rman_error.txt

contents of rman_error.txt
-------------------------

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jul 21 17:49:13 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
START_TIME END_TIME STATUS
---------- --------- -----------------------
14-JUL-08 14-JUL-08 COMPLETED WITH ERRORS
21-JUL-08 21-JUL-08 FAILED
19-JUL-08 19-JUL-08 COMPLETED WITH ERRORS
20-JUL-08 20-JUL-08 COMPLETED WITH ERRORS
20-JUL-08 20-JUL-08 FAILED
21-JUL-08 21-JUL-08 COMPLETED WITH ERRORS
19-JUL-08 19-JUL-08 FAILED
7 rows selected.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
--------------------------------------------------------------------------

Basically i can email the file rman_error.txt BUT i dont want this email alert to be email everyday. I just want mailx email to me when the status of backup is
COMPLETED WITH ERRORS or FAILED.....

Can somebody help me on how to create the script so i can accomplish this??Smilie
 
REPORTER-MAILX(1)						 LIBREPORT MANUAL						 REPORTER-MAILX(1)

NAME
reporter-mailx - Sends contents of a problem directory via email. SYNOPSIS
reporter-mailx [-v] -d DIR [-c CONFFILE] DESCRIPTION
The tool reads a problem directory, composes an email message from the directory contents, and uses mailx to send the message to specified recipient. Properties of email messages can be specified in a configuration file, and via environment variables. Configuration file Configuration file contains entries in a format "Option = Value". The options are: Subject The subject of the email message. EmailFrom The sender of the email message. EmailTo The recipient of the email message. SendBinaryData Use yes/true/on/1 to attach all binary files from the problem directory to the email. This can cause the emails to be very large. Integration with ABRT events reporter-mailx can be used as a reporter, to allow users report problems via email when they decide to do it. This usage is pre-configured in /etc/libreport/events.d/mailx_event.conf: EVENT=report_Mailx reporter-mailx It can also be used to notify administrator automatically when a problem happens. When this is desired, modify the event configuration file to run the tool on the post-create event: EVENT=post-create reporter-mailx OPTIONS
-d DIR Path to problem directory. -c CONFFILE Path to configuration file. When used in ABRT event system, the file contains site-wide configuration. Users can change the values via environment variables. ENVIRONMENT VARIABLES
Environment variables take precedence over values provided in the configuration file. Mailx_Subject Subject of the email message. Mailx_EmailFrom Sender of the email message. Mailx_EmailTo Recipient of the email message. If nor the environment variable nor the corresponding option is defined, the message is send to "root@localhost". Mailx_SendBinaryData Use yes/true/on/1 to attach all binary files from the problem directory to the email. AUTHORS
o ABRT team LIBREPORT 2.1.11 06/18/2014 REPORTER-MAILX(1)
All times are GMT -4. The time now is 10:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy