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
 
SCRIPT-EMAIL(8) 					  System Administration Commands					   SCRIPT-EMAIL(8)

NAME
script-email - Amanda script to send email notifications DESCRIPTION
script-email is an Amanda script implementing the Script API. It should not be run by users directly. It sends a notification email to the addresses specified in the MAILTO property. PROPERTIES
This section lists the properties that control script-email's functionality. See amanda-scripts(7) for information on the Script API, script configuration. MAILTO List of email addresses that will receive an email on command execution. It is a multi-valued property: property "MAILTO" "amanda@domain.com" "sysadmin@domain.com" "amandauser@domain.com" EXAMPLE
In this example, script-email is scheduled to be run before the DLE, on the server. The unqualified email address amanda will be passed to the email system unchanged. The script is then attached to a dumptype, which can then be specified for any DLEs which require notification. define script-tool pre-email { comment "email me before this DLE is backed up" plugin "script-email" execute-on pre-dle-backup execute-where server property "mailto" "amanda" } define dumptype user-tar-email { user-tar script "pre-email" } SEE ALSO
amanda(8), amanda.conf(5), amanda-client.conf(5), amanda-scripts(7) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Dustin J. Mitchell <dustin@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.1 02/21/2012 SCRIPT-EMAIL(8)
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy