cron job is unable to process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cron job is unable to process
# 1  
Old 01-13-2011
cron job is unable to process

Hi All,
I have got a shell script that excutes some job and mails me the output as an attachment.
While running the script manually, its perfect.
when i am scheduling the job through crontab, i am getting the mail.
but the attachment but this is a blank file.

after the scheduler run, i can see the output log has all the details that was there when i ran it manually.

I have tried all the way, and i am sure all the steps are getting executed while running through crontab, but not sure, how the writing to file is not happening.
Code:
echo "script run time is `date`" > info.log
$ORACLE_HOME/bin/sqlplus -s bala/bala << EOM > scriptout.log
SET PAGESIZE 20
SET LINESIZE 80
select job_name, state,run_count, failure_count 
from user_scheduler_jobs 
where job_name in ('BAL_TO_SAAS_MPRTD','SAAS_TO_BAL_MPRTD','OFS_BALA_BILLING_IN','BALA_OFS_BILLING_OUT','OFS_BALA_BILLING_IN_NEW','BALA_OFS_BILLING_OUT_NEW','OS_BAL_MPRTD_IN','BAL_OS_MPRTD_OUT','OS_TO_BALA','BAL_TO_OS_MBD','AIB_TO_BAL_MBCC','AIB_TO_BAL_MBCD','AIB_TO_BAL_MBO','BAL_TO_AIB_MBCC','BAL_TO_AIB_MBCD','BAL_TO_AIB_MBO')
;
EOM
uuencode scriptout.log status.log | mailx -m -s "preflight report" "gxx.prxxxi@yy.com"

Im getting mad. really mad. please help

Last edited by vbe; 01-13-2011 at 02:13 PM.. Reason: typos - no emails
# 2  
Old 01-13-2011
Have you set the required environment variables $ORACLE_HOME, $ORACLE_SID, $PATH ...?
# 3  
Old 01-13-2011
If the script went wrong in cron, the error messages can be found in unix mail for the owner of the crontab.


Tip: Use Oracle "spool <logfilename>" and "spool off" commands to write the output of your Oracle program to a file. Use Oracle "set" commands to turn off unwanted output from sqlplus once the script is tested.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job for MySQL process

Hi, How can I write a cron job that runs the MySQL "show processlist" command and stores in log file every 5 seconds between 5 am to 7 am? I know the lowest possible timing I can have in cron is a minute not second. If I need a script, I am looking for a solution in Bash. I think this cron... (2 Replies)
Discussion started by: riomario
2 Replies

2. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. Shell Programming and Scripting

Cron job and shell script to kill a process if memory gets to high

Hello, I'd like to set a cron job that runs a shell script every 30 minutes or so to restart a java based service if the memory gets above 80%. Any advice on how to do this? Thanks in advance! - Ryan (19 Replies)
Discussion started by: prometheon123
19 Replies

6. Shell Programming and Scripting

unable to schedule job in cron

Hi, from normal user(oracle) i am unable to run scheduled job in cron: os version: bash-2.03$ uname -a SunOS sumail02 5.8 Generic_117350-39 sun4u sparc SUNW,Ultra-60 bash-2.03$ crontab -l 55 * * * * sh /oracle/statistics.sh > /dev/null 2>&1 bash-2.03$ cat /oracle/statistics.sh... (2 Replies)
Discussion started by: prakash.gr
2 Replies

7. Solaris

Cron Job -- auto start process when it dies

I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message.... can any one help writing a script? thanks (3 Replies)
Discussion started by: chandravadrevu
3 Replies

8. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

9. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

10. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies
Login or Register to Ask a Question