Execution Problems with Crons


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Execution Problems with Crons
# 8  
Old 06-06-2012
I am really confused with this. There is no more lines in cron log matching PID 10934 as shown below :-

Code:
root@localhost log]# grep "10934" cron
Jun  5 07:25:02 localhost crond[10934]: (root) CMD (/home/oracle/tab.sh)

I did not find any mail for oracle user.

Quote:
Originally Posted by methyl
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.
# 9  
Old 06-06-2012
So what do you have in root's mbox then?
# 10  
Old 06-06-2012
Quote:
Originally Posted by vbe
So what do you have in root's mbox then?

Here is it.

Code:
[root@localhost mail]# grep "cron" root
    4:vixie-cron-4.1-77.el5_4.1.i386

# 11  
Old 06-06-2012
I don't know which is the default Shell for cron jobs in Redhat 5.
If it is not the same as the Shell in your interactive account, then you will need a Shebang line on the first line of the script to cause it to execute with the correct Shell.

Is it the same script as in your previous thread? :
https://www.unix.com/shell-programmin...oracle-db.html
# 12  
Old 06-06-2012
Yes it is the same script as in my last thread. One interesting note that I created the cron job s from my Oracle user, will I try to create the same cron job from root user and see the result? What's your opinion?



Quote:
Originally Posted by methyl
I don't know which is the default Shell for cron jobs in Redhat 5.
If it is not the same as the Shell in your interactive account, then you will need a Shebang line on the first line of the script to cause it to execute with the correct Shell.

Is it the same script as in your previous thread? :
https://www.unix.com/shell-programmin...oracle-db.html
# 13  
Old 06-06-2012
First, let's take a proper look at the root mailbox.
Read the file with more and search for the name of your script.
I suspect that you will see syntax errors for the "export" lines because your Shell in cron is not suitable for your script, or maybe some other error?
If it's not in the root mailbox, try the oracle mailbox. The cron log however suggested that the job failed before cron had a chance to change the user to oracle.

If you create the job as a root cron, the crontab line will need a "su oracle" (or whatever is appropriate in Red Hat). There is no real advantage to doing this.


Permissions on the script might be wrong?
What's the output from:
Code:
ls -lad /home/oracle/tab.sh

 
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