Execution Problems with Crons


 
Thread Tools Search this Thread
# 8  
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  
So what do you have in root's mbox then?
# 10  
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  
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  
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  
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

 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execution Problems with Solaris 8

i have problems with using solaries 8 . code and commands for extracting files from CD ? especially extracting file.jar from package and batch (1 Reply)
Discussion started by: moh_abaloo
1 Replies

2. Shell Programming and Scripting

Execution Problems with awk

Ubuntu, Bash 4.3.48 Hi, I have this input file: a1:b2:c30:g4:h12:j7 and I want this output file: a1=g4:b2=h12:c30=j7 I can do it this with this code: awk -F':' '{print $1"="$4":"$2"="$5":"$3"="$6"}' INPUT > OUTPUTIn this case I have 6 columns, I calculate manually the half number of... (6 Replies)
Discussion started by: echo manolis
6 Replies

3. 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

4. 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

5. 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

6. 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

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. 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

10. UNIX for Dummies Questions & Answers

Execution problems with crontab

I need your help please Inin a production system i found crontab entries was removed because i typed crontab -l with username corasc and didn't show anything. i asked the administrador to restored the mentioned crontab, he restored the crontab: The problem is when restored the crontab file is... (2 Replies)
Discussion started by: alexcol
2 Replies

Featured Tech Videos