Executing in crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Executing in crontab
# 1  
Old 09-19-2006
Executing in crontab

Hi,
if I launche this at commande line It is OK :
Code:
$ /home/oracle/anaschxt_A01_5_15_25_plemae.sh

but if I put it in crontab :
Like this :
I have this error :
Code:
/home/oracle/anaschxt_A01_5_15_25_plemae.sh[20]: sqlplus:  not find.

The script is :
Code:
 +17  ##%com_finm#####################################################
   +18
   +19
   +20  sqlplus -s schxt/schxt@plemae << EOF
   +21  whenever sqlerror exit sql.sqlcode;
   +22  whenever oserror exit FAILURE
   +23  BEGIN
   +24  dbms_stats.gather_table_stats('SCHXT','A01_MAJPAI',cascade=>true);
   +25  dbms_stats.gather_table_stats('SCHXT','A01_PAI_INF',cascade=>true);
   +26  dbms_stats.gather_table_stats('SCHXT','A01_PAI_P01',cascade=>true);
   +27  dbms_stats.gather_table_stats('SCHXT','A01_PAI_P02',cascade=>true);
   +28  END;
   +29  /
   +30
   +31  EOF

Would you help me please.
# 2  
Old 09-19-2006
when you are able to run in prompt and not through crontab is :

PATH is not properly set (with terminals we have all the envs properly set and for crontabs we have to explicitly mention as we dont load the .$HOME/.profile )

set the sqlplus path in the script which is invoked through cron .. Smilie
# 3  
Old 09-20-2006
Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script not executing

Hi, am facing some problem while inserting a record into a script Please find script below. `sqlplus -s asdf/asdf123 <<eof! set feedback off; set heading off; set verify off; insert into... (3 Replies)
Discussion started by: senkerth
3 Replies

2. UNIX for Dummies Questions & Answers

Script not executing

Hello, I wasn't sure where to post this so I posted it here. I've used UNIX quite a bit, LINUX not so much. For some reason, my LINUX script will not execute if I type in the script name and press enter. I'm in the directory where the script is. test.sh However, when I use ". ./" it... (5 Replies)
Discussion started by: jsanders
5 Replies

3. Debian

Problems with Crontab not executing scripts after edit

Hi all I installed Debian and i have a few scripts that outputs what is happening. The wierd part...after fresh install all works ok but after i open or edit Crontab it stops executing the scripts...and scripts runs manually so its not a problem with scripts...what happens is that i usually... (3 Replies)
Discussion started by: ro0t3d
3 Replies

4. UNIX for Dummies Questions & Answers

probs executing crontab script

Hi everyone In an existing crontab script for the root user, I've added 5 new lines of code, however for some unknown reason, these lines of code were not executed. Here is what I did 30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /picnic 30 0 * * *... (6 Replies)
Discussion started by: JamesGoh
6 Replies

5. Shell Programming and Scripting

Script not executing in CRONTAB

Hi, I have written a script for file scan : #!/bin/sh find . -name "common.log.diff" > /dev/null 2>&1 if ; then cp common.log common.log.diff diff common.log common.log.diff > DIFFERENCE.log cp common.log common.log.diff grep "ERROR" DIFFERENCE.log if ; then echo "1" >... (6 Replies)
Discussion started by: himvat
6 Replies

6. Shell Programming and Scripting

Executing Stdout ???

Hiya all, Simple question - yet no simple answer im afraid ! Is there a way to execute a shell script (child) which returns one line and get the current (parent) shell to execute the stdout from the child ??? example child.sh #!/bin/sh echo "setenv DISPLAY xxx:03" parent_prompt>... (5 Replies)
Discussion started by: fawqati
5 Replies

7. Shell Programming and Scripting

executing a cron

Hi Gurus I have a requirement to execute a cron job every 30 min until 8pm in the night and again start at 8 am in the morning. How would I add the cron entry for this requirements. all inputs are appreciated. Thanks in advance (8 Replies)
Discussion started by: ragha81
8 Replies

8. Shell Programming and Scripting

Problem with executing a script scheduled in crontab

Hi I have written a shell script(in Solaris) in which following logic is there..... i=1 while read control do key=`echo $control | awk -F$DELIMITOR '{ print $1 }'` echo "Key Values" ${key} i=`/usr/bin/expr $i + 1` done < $CONFPATH/$CONFFILE when i execute it at prompt it... (4 Replies)
Discussion started by: Amardeep
4 Replies

9. Shell Programming and Scripting

Overlapping(executing time) jobs in crontab

I do not have the luxery of a server that i can try on, so i had to post my qn here. Say i have two jobs in the cron table, the jobs are scheduled 2 mins apart. Assuming the first jobs does a lot of operations and takes > 2 mins. Will the second job be executed? Will Unix actually have a queue... (3 Replies)
Discussion started by: new2ss
3 Replies

10. Programming

Errors while executing a.out

Hi, I tried a simple hello.cc program in Unix. - Compiled with no errors - Created a.out successfully - While executing a.out, following error message appeared " ld.so.1:a.out fatal: libstdc++.so.2.10.0: Open failed: No such file or directory Killed" ... (1 Reply)
Discussion started by: nirthana
1 Replies
Login or Register to Ask a Question