Solved

Cron Job success

Posted on 2013-01-25
6
509 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
6 Comments
 
LVL 73

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 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 73

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now