Execution Problems with Cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Execution Problems with Cron
# 1  
Old 06-03-2013
Execution Problems with Cron

Good evening, ive got this cron to be run:

Code:
[5 0 * * * /export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1

if i run this manually it doesnt work,it takes me to the prompt again

Code:
/export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1

here is the code fragment:
Code:
coopge@coopge: opge PRODUCCION>more /export/app/CO/opge/scr/Informe_parametros_colombia.ksh
#!/bin/ksh
. .profile
 
#ORACLE_HOME=/softw/app/oracle/product/9.2.0;export ORACLE_HOME
#PATH=/usr/bin:/usr/sbin:.:/softw/app/oracle/product/9.2.0/bin; export PATH
#ORACLE_SID=DATABASEXX; export ORACLE_SID
 
 
fecha=`date +'%Y%m%d%H%M%S'`
sqlplus -s userxx/Temporal << fin
set feedback off
set linesize 1000
set pagesize 0
set head off
set trims on
set termout off
set serveroutput off
spool /export/app/CO/ppcs/datos/sdp/CO_Reportes/Imsi_$fecha.lis
 
alter session set nls_date_format = 'yyyy/mm/dd hh24:mi:ss';
 
select
num_telefono||'|'||
imsi||'|'||
asl||'|'||
cod_nir
from poge_paramred ;
 
spool off
exit;
fin
 ]

dont know if has sth to do with user right access, how can i check it out?
Thanks in advanced
# 2  
Old 06-04-2013
Try it like this to see what/if error occurs in your sql:
Code:
#!/bin/ksh
. .profile
fecha=`date +'%Y%m%d%H%M%S'`
fecha_results=`sqlplus -s userxx/Temporal <<fin
--set feedback off
set linesize 1000
set pagesize 0
set head off
set trims on
set termout off
set serveroutput off
spool /export/app/CO/ppcs/datos/sdp/CO_Reportes/Imsi_$fecha.lis
whenever sqlerror exit 1
 
alter session set nls_date_format = 'yyyy/mm/dd hh24:mi:ss';
 
select
num_telefono||'|'||
imsi||'|'||
asl||'|'||
cod_nir
from poge_paramred;
 
spool off
exit 0;
fin`

if [[ $? -eq 1 ]] then
  print `date "+%Y-%m-%d-%H.%M.%S"` "Process($0) failed, error occurred..."
  # Remove leading form feed from variable
  fecha_results=`print $fecha_results | tr -d '\f'`
  print `date "+%Y-%m-%d-%H.%M.%S"` "fecha_results: $fecha_results"
else
  print `date "+%Y-%m-%d-%H.%M.%S"` "Process($0) completed..."
  # Remove leading form feed from variable
  fecha_results=`print $fecha_results | tr -d '\f'`
  print `date "+%Y-%m-%d-%H.%M.%S"` "fecha_results: $fecha_results"
fi

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

2. Shell Programming and Scripting

Wall execution problems from cron

So I've been tasked with creating a shell script to run in a cron every few minutes to check duplex settings on my eth0 nic card. I would like for the server to send a wall message to whoever is on the console or in a terminal session. Below is what I have so far. 0,10,20,30,40,50 * * * * ... (7 Replies)
Discussion started by: lutador72
7 Replies

3. SuSE

Wall execution problems from cron

So I've been tasked with creating a shell script to run in a cron every few minutes to check duplex settings on my eth0 nic card. I would like for the server to send a wall message to whoever is on the console or in a terminal session. Below is what I have so far. 0,10,20,30,40,50 * * * * ... (1 Reply)
Discussion started by: lutador72
1 Replies

4. Shell Programming and Scripting

Execution problems with cron

I am new to creating crontab file , i just wrote below (40 19 * 3 * /root/maths/practisecron.sh), the script just prints "Hi". When ever i save the above file i am getting this . # crontab -e crontab: installing new crontab Can you please check where it went wrong.. (1 Reply)
Discussion started by: vkiyv05
1 Replies

5. UNIX for Dummies Questions & Answers

Dsh command : Execution Problems with Cron

Hi, On linux cluster, i created a script to delete all temp files older than 5 days. i am able to execute the script "dsh -ea script.ksh" in management node directly But when i schedule "dsh -ea script.ksh" in crontab in management node it tells dsh command not found. How to solve... (2 Replies)
Discussion started by: smartrajusid
2 Replies

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

7. UNIX for Dummies Questions & Answers

Execution Problems with Cron

Hi friends, today i created a cron job , registered the crontab file associated but dont know why the cron is not getting executed at the right time.?? content of Crontab file : 21 15 * * * /subrat/myt i wanted to execute the script myt on 15:21 PM of everyday. the script myt... (2 Replies)
Discussion started by: paras.oriental
2 Replies

8. Shell Programming and Scripting

Execution Problems with Cron

Hi, I have written a shell script to transfer files to a SFTP server passing the filername, source and dest directory as parameters and it runs well. :) I want to schedule this script to run periodically using a cron job. root@pingu # cat /etc/crontab SHELL=/bin/bash... (1 Reply)
Discussion started by: chetancrsp18
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