Log file is not updating when I run shell scripts scheduled thru crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Log file is not updating when I run shell scripts scheduled thru crontab
# 1  
Old 10-23-2016
Wrench Log file is not updating when I run shell scripts scheduled thru crontab

Hi Forum,

Good Day!

I have created an empty html file wtih permissoin 777
created shell script(with permission 777) , code is below.
Code:
#=======================start==============

. /data09/oracle/apps_st/appl/D_oraapp095.env
rm -rf /home/mnp/Test_log.txt

echo "=============================================================================<br><br>" >> /home/mnp/Test_log.txt
echo -e "\t Program - Daily Rates Import and Calculation <br>" >> /home/mnp/Test_log.txt
echo "--------------------------------------------------------<br><br>" >> /home/mnp/Test_log.txt
unixvar6=`sqlplus -s apps/XXXX@DEV <<EOF
SET FLAGGER OFF FEEDBACK OFF ECHO OFF TERMOUT OFF VERIFY OFF HEADING OFF COLSEP |
SELECT status_code
   FROM APPS.fnd_conc_req_summary_v
 WHERE request_id =
 (         SELECT MAX(request_id)
            FROM APPS.fnd_conc_req_summary_v
           WHERE CONCURRENT_PROGRAM_ID = 44496
--request_type_display_name = 'Program - Daily Rates Import and Calculation'
             AND phase_code='C'
		     );
Exit
EOF`
unixvar_6=`sqlplus -s apps/XXXX@DEV <<EOF
SET FLAGGER OFF FEEDBACK OFF ECHO OFF TERMOUT OFF VERIFY OFF HEADING OFF COLSEP |
     SELECT 'Request ID: '||request_id||'  Phase Code: '|| 
decode(phase_code,'C','COMPLETED')||'  Status Code: '||
decode(status_code,'C','COMPLETED', 
 'D', 'CANCELLED',
 'E', 'ERROR',
'G', 'WARNING',
'M','NO MANAGER',
'S','SUSPENDED',
'U', 'DISABLED',
'X', 'TERMINATED')||'  Start Date: '||TO_CHAR(actual_start_date,'DD-MON-YYYY HH24:MI:SS')
||'  End Date: '||TO_CHAR( actual_completion_date,'DD-MON-YYYY HH24:MI:SS')
||'  Program Name: '||USER_CONCURRENT_PROGRAM_NAME
    FROM APPS.fnd_conc_req_summary_v
   WHERE request_id =
 (              SELECT MAX (request_id)
                FROM APPS.fnd_conc_req_summary_v
               WHERE CONCURRENT_PROGRAM_ID = 44496
                     AND phase_code = 'C' );

		     
Exit
EOF`
echo "STDCERR: ${STDCERR}"
STDCERR=`echo $unixvar6 | sed -e 's/Connected. //'`
if [ $unixvar6 == 'E' ]
then
echo " CRITICAL : Request set is completed with Error <br><br>" >> /home/mnp/Test_log.txt
echo " $unixvar_6  " >> /home/mnp/Test_log.txt
else
echo " Normal: Request set is completed <br><br>" >> /home/mnp/Test_log.txt
echo " $unixvar_6 " >> /home/mnp/Test_log.txt
fi
#=====================================end====



Here I could get the program request details when i ran the script manually.

But i don't get any details when I schedule them thru crontab.


Can Someone help me why log is storing the details ?

Thanks in Advance!


-Kartheek

Moderator's Comments:
Mod Comment Welcome, please use code tags for your code and data, thanks

Last edited by vbe; 10-23-2016 at 04:51 PM..
# 2  
Old 10-23-2016
What do you call details?
What dont you get?
Cron logs its activity what do you see there?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script when scheduled in Crontab gives extra records in output

Hi, We have created a script that's checks the latency of IIDR subscription by fetching details from a config file (that contains subscription details) and running the CHCCLP command. The out put is then concatenated in a csv file. Once all subscription details are saved the script send a mail... (7 Replies)
Discussion started by: ab095
7 Replies

2. UNIX for Beginners Questions & Answers

Script gives error when scheduled in crontab

i have written one script which is working fine when i run it manually but giving error when i schedule it in crontab. cat SUMMARY.sh #!/bin/bash DT1=`date +%Y%m%d` echo "Off PP TT" >>summary_$DT1.txt cat ues1.txt_$DT1 >>summary_$DT1.txt cat ues2.txt_$DT1... (2 Replies)
Discussion started by: scriptor
2 Replies

3. Shell Programming and Scripting

Scheduled job not running automatically in crontab

i have a job scheduled in crontab. The problem is, it is not running automatically as per the time scheduled. But runs when executed manually. What would be the problem? Help me with this please. (6 Replies)
Discussion started by: Santhosh CJ
6 Replies

4. Shell Programming and Scripting

Having a single Log file for all the shell scripts

Bash on RHEL 6.2 We have multiple shell scripts executed by cron jobs. Each Shell script has its own log files currently. Most of them have logs generated using spool command from Oracle RDBMS's sqlplus commmand. Sample: #!/bin/bash sqlplus -s scott/tiger << EOF spool... (5 Replies)
Discussion started by: kraljic
5 Replies

5. Red Hat

Script not working if crontab scheduled

Hi all, I'm working to a script with /bin/bash shebang. The script works perfectly if I run from command line. The script runs under a non root user and inside the commands are set with sudo command in a such a way they can be run under root, for example (first rows of the script):... (5 Replies)
Discussion started by: idro
5 Replies

6. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

7. UNIX for Dummies Questions & Answers

crontab scheduled details required

Hi, I have the below job scheduled in crontab. Can you please tell me at what interval this job is scheduled? Where is the name of the job defined here? I will definitely go through the UNIX documentation a little later, for the time being, please provide me few details on this. Thank you. ... (0 Replies)
Discussion started by: Dev_Dev
0 Replies

8. Shell Programming and Scripting

Updating a CSV file by multiple PERL scripts

Hi Friends, I'm writing code to update a CSV file by multiple PERL scripts. I've around 2000 PERL scripts which need to register their entries into a CSV file. Hence, I'm inserting following line code in all the 2000 PERL scripts. open(FILE,... (5 Replies)
Discussion started by: Lokesha
5 Replies

9. Shell Programming and Scripting

How do i run a shell script without crontab.

Hi Folks, Could you please suggest me how to run a shell script on a solaris env without using crontab. I am actually trying to write a shell script which will grep "WORD" in the logfile andd sends a email.Thanks in advance. Thanks Sandeep. (3 Replies)
Discussion started by: sandeep anand
3 Replies

10. 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
Login or Register to Ask a Question