Problem with Crontab execution


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with Crontab execution
# 1  
Old 07-17-2009
Problem with Crontab execution

Hi

I have shell script to excute the SQL script.And i have scheduled those shell script in crontab.But the Shell script is not running timely and i got the below error
Crontab entry
Code:
15 05 17 7 * /export/home/vcpsapp/vcps/stat.sh

Output
Your "cron" job on uspxivus16
/export/home/pcvsapp/rvcps/stat.sh

produced the following output:
/export/home/pcvsapp/rvcps/stat.sh: sqlplus: not found

Please help me Thanks In advance

Last edited by Yogesh Sawant; 07-17-2009 at 06:41 AM.. Reason: added code tags
# 2  
Old 07-17-2009
in stat.sh file, enter the full path of sqlplus. use these commands to find where it is:
Code:
which sqlplus
whereis sqlplus
whence sqlplus
locate sqlplus
find / -type f -name 'sqlplus' 2>/dev/null

# 3  
Old 07-17-2009
Quote:
Originally Posted by mak_boop
[...]
/export/home/pcvsapp/rvcps/stat.sh: sqlplus: not found
You should add $ORACLE_HOME/bin to the search path inside the script:

Code:
PATH=$PATH:$ORACLE_HOME/bin


Last edited by radoulov; 07-17-2009 at 08:08 AM..
# 4  
Old 07-17-2009
When you execute a program from CRONTAB, the job will have basic environment setting. So as others said, you have to set the env configuration required for you program inside the shell script you are executing. As such I could think of the following:

Code:
ORACLE_SID=
ORACLE_HOME=
PATH=$PATH:$ORACLE_HOME/bin

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Crontab Execution

Hi Guys, I need help to clear my doubt w.r.t Crontab execution. uname -a HP-UX myservername B.11.31 U ia64 1422528451 unlimited-user licenseI created a crontab entry to execute particular job on Saturday 11/15/2014 11:22 Below is the cron entry #refresh DEVDB from PRODDB 22 11 15 11 6... (6 Replies)
Discussion started by: rocky.community
6 Replies

2. UNIX for Dummies Questions & Answers

Execution Problems with Crontab

Dear Folks, I have written a shell script which internally connects to oracle database through sqplplus command line. The script runs fine when run manually. Now I am scheduling it to run (Linux environment) from crontab. In crontab it is failing with an error: sqlplus command... (6 Replies)
Discussion started by: tamojitc
6 Replies

3. UNIX for Dummies Questions & Answers

Execution problem

How to search a pattern from multiple files... i used the command suppose the pattern name is xxx grep xxx (file1-o- file2-o- file3) Thanks in advance (4 Replies)
Discussion started by: ksakil
4 Replies

4. UNIX for Dummies Questions & Answers

execution problem

HI I am trying to check the status of port using command /code: netstat -an | grep port /Output: *.2009 *.* 0 0 65535 0 LISTEN what i am trying to do is i want to grep only status Wether the port is established/listen if so show ok else... (1 Reply)
Discussion started by: esumiba
1 Replies

5. UNIX for Dummies Questions & Answers

execution problem

Hi i have a file in which there are three fields code: 919804199233 404911130003916 357266044991350F and now i want to add two more fields i.e. code: 919804199233 404911130003916 357266044991350F ms 123 how can i do it using command line and if have a file of 100... (8 Replies)
Discussion started by: esumiba
8 Replies

6. Shell Programming and Scripting

Problem with Job execution using crontab

Hi All, I am facing a problem with crontab.I made an entry in crontab like this 05 07 * * * /afs2/cdwfullacc/current/exe/cdw_generate_special_klant.sh > /afs2/cdwfullacc/current/scratch/cdw_gen_cron.log But job was not getting executed. Entry in crontab was made with same user by whom... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

7. Shell Programming and Scripting

Execution of Unix script after every second without crontab

Hi, I have shell script "A" which is executing oracle pl/sql procedure and initiate its multiple threads at a time as below on given user value in an other script "B". I want to execute script "A" after every second with out cron tab as " A " will keep on executing after every second till... (1 Reply)
Discussion started by: saad.imran@gmai
1 Replies

8. UNIX for Dummies Questions & Answers

Unscheduled crontab execution

Hi All, Do apologise, for it has been a long while since I was last on the forum. I've been doing documentation and primiarily Windows efforts for some while now. :( We are running a HP-UX 11.23 unit. This morning two separate crontab users executed shutdown scripts of their respective... (14 Replies)
Discussion started by: Cameron
14 Replies

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

10. Shell Programming and Scripting

crontab execution

is it possible to soecify time overnight in 5 days for example: 0 18-7 * * 1-5 /mycode is this okay to use 18-7 because im not getting the results correctly? (4 Replies)
Discussion started by: vadharah
4 Replies
Login or Register to Ask a Question