Execution Problems with Crons


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Execution Problems with Crons
# 1  
Old 06-05-2012
Execution Problems with Crons

Buddies, cron is not executing any monitoring scripts for 'Oracle' user in Red Hat Linux 5.
Details about the cron job :-
Code:
oracle@localhost ~]$ crontab -l
 15  7  * * * /home/oracle/tab.sh

The tab.sh script when firing manually is working fine.

Any inputs/advice will be great for me.

Last edited by vbe; 06-05-2012 at 12:32 PM.. Reason: code tags.. bad attempt by the thread owner
# 2  
Old 06-05-2012
What's the error message? Errors will get e-mailed to the login name of the process running the cron job. Hopefully the shell script you are running is writing to a log for even more info. At any rate, the Oracle environment needs to be set inside the script itself. When you are running from the command line, your environment most likely already has ORACLE_HOME, ORACLE_SID, etc set in your .profile so it works fine from there. Set them at the top of your script and try it again.
# 3  
Old 06-05-2012
Quote:
Originally Posted by gary_w
What's the error message? Errors will get e-mailed to the login name of the process running the cron job. Hopefully the shell script you are running is writing to a log for even more info. At any rate, the Oracle environment needs to be set inside the script itself. When you are running from the command line, your environment most likely already has ORACLE_HOME, ORACLE_SID, etc set in your .profile so it works fine from there. Set them at the top of your script and try it again.


How can I get the error messages for the cronjob ? My scripts begins with setup of Oracle Environment, so that's not a challenge, correct me if I am wrong. The output of the script file is written to another log file which is not generating by which I determined that cronjob is not working, but when I am running the script manually instead of cronjob, it is working fine. What other troubleshooting can I do under this scenario? Any advice /inputs will be highly appreciated.
# 4  
Old 06-05-2012
Did you not read this recent thread that explains it all:
https://www.unix.com/unix-dummies-que...tab-entry.html

If you search the forum you will find many posts on the subject
# 5  
Old 06-05-2012
Start by redirecting STDIN and STDOUT to some files in a directory writeable by you...
Cron has a log file, look in it for some information, on AIX and HP-UY you will find a /var/adm/cron directory with a log file... in RH5 I have no idea, somewhere in /var/log?
Then as Gary mentionned, you should have a message in your mbox about cron - What does it say?
# 6  
Old 06-05-2012
Here what I got from cron log

Code:
Jun  5 07:25:02 localhost crond[10934]: (root) CMD (/home/oracle/tab.sh)
Jun  5 07:27:34 localhost crontab[10950]: (oracle) LIST (oracle)
Jun  5 07:30:01 localhost crond[11021]: (root) CMD (/usr/lib/sa/sa1 1 1)
Jun  5 07:40:01 localhost crond[11140]: (root) CMD (/usr/lib/sa/sa1 1 1)

Any further things which I need to check more

Thanks once again for the great assistance !

Last edited by Scrutinizer; 06-05-2012 at 01:51 PM.. Reason: code tags
# 7  
Old 06-06-2012
Also search for more lines in your cron log matching PID 10934 . There should be a line with a result code ... unless the script hangs.

Anything in unix mail for account "oracle" or account "root" ?


Strange discrepancy between the scheduled time from crontab and the entry in the log.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execution problems

How to find a word in a directory which contains many files? i just want to count how many such words are present in all the files? This is the code which i tried for a single file echo "Enter the file name:" read file echo "Enter the word to search:" read word if then echo "The count... (4 Replies)
Discussion started by: Meeran Rizvi
4 Replies

2. UNIX for Dummies Questions & Answers

Execution Problems with Cron

Good evening, ive got this cron to be run: if i run this manually it doesnt work,it takes me to the prompt again /export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1 here is the code fragment: coopge@coopge: opge PRODUCCION>more... (1 Reply)
Discussion started by: alexcol
1 Replies

3. UNIX for Dummies Questions & Answers

Execution Problems with UNIX.

Hi Team, I created one file like tst.pl, it contains #!/usr/bin/perl use Spreadsheet::ParseExcel; During execution it's showing error like use: command not found. Pleast let me suggest how to use this perl menthods in Unix. Thanks in Advance, Reards, Harris (5 Replies)
Discussion started by: harris
5 Replies

4. Shell Programming and Scripting

Execution problems with sed

Hi,I confused how to use sed to deal with big file. example: the big file have some different urls just with filename. how can i use sed to fetch url except file name and replace to other urls with filename? thanks!!! (11 Replies)
Discussion started by: hshzh359
11 Replies

5. Solaris

Execution problems with Mailx

Unable to send mail using mailx command. I am using solaris 5.9 I am trying to send notification for the scheduled jobs in crob but the mailx is not working. Checked the settings in submit.cf and sendmail.cf but unable to find the solution. Error message root@sshldb # nslookup mailhost... (8 Replies)
Discussion started by: Srinathkiru
8 Replies

6. Shell Programming and Scripting

Execution Problems with if statements

Hi all, I habe a file called test.log, which contain following data : 0.0 0.1 0.1 0.1 0.1 0.2 0.3 0.3 0.4 0.4 0.6 8.7 8.8 17.2 I want to show the data which gater than 9.0 But my script not working. (4 Replies)
Discussion started by: mnmonu
4 Replies

7. Shell Programming and Scripting

Execution Problems

this my source file ************* fixed *************** Begin equipmentId : d9 processor : fox number : bhhhhhh Variable # 1: Id : 100 Type : 9 nType : s gType : 5f mType : 4 LField : England DataField : london Length ... (6 Replies)
Discussion started by: teefa
6 Replies

8. Shell Programming and Scripting

Execution Problems!!

i have been working on this for a about 12 hours today say's end of file un expected any idea's using the bourne shell and its driving me nuts worked fine in bash but prof says make it work in bourne and good luck worth 13% any help would be awesome #!/bin/sh trap "rm mnt2/source/tmp/* 2>... (1 Reply)
Discussion started by: mrhiab
1 Replies

9. UNIX and Linux Applications

Execution Problems with Cron

Hi all!! I have a nerve-wracking concept (probably for me!!) which is not understood. My crontab entry looks this way. 33 09 22 3 * /home/myexp.sh "Bgp4 ALL" >/dev/null 2>&1 But cron gets started occasionally. Sometimes it does. Sometimes it does not. And sometimes it hangs in the middle (I... (1 Reply)
Discussion started by: dhivyasuresh
1 Replies

10. Programming

execution problems with cron

how to store a date into file? and how we can access date from the file? ---------- Post updated at 06:09 AM ---------- Previous update was at 06:08 AM ---------- how we can store date in file? (1 Reply)
Discussion started by: causalmodi777
1 Replies
Login or Register to Ask a Question