Solved

Cron Job success

Posted on 2013-01-25
6
521 Views
Last Modified: 2013-01-26
I quickly need to know.
How to make sure that if the cron job has run successfully in solaris?

Db:  Oracle
OS:  Solaris
0
Comment
Question by:taaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 150 total points
ID: 38818829
oracle doesn't interface with cron,

you could write a java stored procedure or c external procedure to invoke os commands.


or, if your cron job writes to a log file, you could use utl_file or a bfile to read the log and check status.


if you really want your database to monitor your job execution, you might want to consider using  dbms_scheduler inside the database
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 150 total points
ID: 38818853
Several options:

- Have the cron job create output, redirected to a log file, watch the log file
- Have the cron job mail it's result in case of errors to you
0
 

Author Comment

by:taaz
ID: 38819017
that is exactly the option I am looking for.
How do I set up the cron job to send me an email once the job has run fail or success?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 74

Expert Comment

by:sdstuber
ID: 38819041
this isn't an oracle question at all?
0
 
LVL 23

Accepted Solution

by:
David earned 200 total points
ID: 38819602
# Ping if job was unsuccessful
SOMEJOB > /dev/null 2>&1
SOMEJOB_output=`echo $?`
###########   TEST CODE
echo "$SOMEJOB_output"
#######################
if [[ "$SOMEJOB_output" != "0" ]]; then
         echo "Trouble in River City..."
         mailx -s "SOMEJOB failure" user@domain.com >/dev/null
 else
         echo "MTS files in use; skipping"
fi

many sources and variations, but this source was from http://www.unix.com/shell-programming-scripting/126811-fuser-exit-code-different-when-script-run-cron.html.
0
 

Author Closing Comment

by:taaz
ID: 38822276
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
best datatype for oracle table email creation 8 104
oracle DR - data guard failover. 18 73
Input a SQl, output tables amd columns used in the SQL 19 72
construct a query sql 11 42
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question