CRON is not working perfectly


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting CRON is not working perfectly
# 8  
Old 01-17-2008
Java

Quote:
Originally Posted by manas_ranjan
i just wanna to know...
why the path for oracle/sqlplus needs to set in my coding level of profile values???knowing that these are already there in .profile of that particular user which invokes the cron.

i have added these values just to know that every parameter(global n local) are properly set while running my cron, but of no use ..now i am going to add this PATH variable , let see what happens.
But my understanding is that cron is executed on-behalf of root.So the .profile file of the user was not be effective.
You can create a file under the name profile.env and source it in each script as "source profile.env".This will be effective.
# 9  
Old 01-17-2008
I dont think that the values exported via users .profile may be available for the cronjob.So its always better to specify the explict path as used in your script,the only explicit path which was missed in your script is that of the "sqlplus",so it is quite simpler to specify the explicit path in the execute_sql function instead of going for exporting PATH in your script as you have defined the ORACLE bin path.

Thanks
Nagarajan G
# 10  
Old 01-18-2008
thanks a lot ennstate and DILEEP410 for your kind help .
Now my cron is working fine .
# 11  
Old 07-29-2008
Shell script is not working in CRONTAB

Hi All,

I have a shell script which does decryption(calling subscript) and other s necessary tasks. It runs fine when I run localy.But when I placed in CRONTAB, the decrption part is not working.

Here I attached dec.sh (decryption script) and credit_settle.sh(main script).

I appreciate, if anyone provide valuable suggestions to fix this issue.

Thanks
arun

Last edited by arun72; 07-29-2008 at 04:07 PM.. Reason: Wrong heading
# 12  
Old 07-29-2008
Shell script are not working in CRONTAB

Hi All,

I have a shell script which does decryption(calling subscript) and other s necessary tasks. It runs fine when I run localy.But when I placed in CRONTAB, the decrption part is not working.

Here I attached dec.sh (decryption script) and credit_settle.sh(main script).

I appreciate, if anyone provide valuable suggestions to fix this issue.

Thanks
arun
# 13  
Old 07-29-2008
When executing from crontab the environment is not set (.profile is not executed before).
A solution is to execute the .profile in the crontab command line, for example :
Code:
00 01 * * * . ~/.profile; /path/to/credit_settle.sh

Jean-Pierre.
# 14  
Old 07-29-2008
Java

Quote:
Originally Posted by arun72
Hi All,

I have a shell script which does decryption(calling subscript) and other s necessary tasks. It runs fine when I run localy.But when I placed in CRONTAB, the decrption part is not working.

Here I attached dec.sh (decryption script) and credit_settle.sh(main script).

I appreciate, if anyone provide valuable suggestions to fix this issue.

Thanks
arun
Is it showing any errors, please mention.Normally as aigles says crontab is executed from different uid permissions,so that it won't set the environment by calling .profile since it's user specific.But i think you are not using .profile,isn't it?

Regards
Dileep
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SuSE

Cron not working

Hi, It is SLES 10.3 VM. Suddenly cron stopped working on this and I am not able to figure out, where it is failing. It is not running with even root. I gave a simple job of redirection of 'date' command, that also doesn't work. Can somebody help me to fix this ? vmprdt23:~ # ps -ef | grep -i... (4 Replies)
Discussion started by: solaris_1977
4 Replies

2. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 Replies

3. Homework & Coursework Questions

Program run perfectly without error but cant show anything

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: No problem,but it cannot show what I want 2. Relevant commands, code, scripts, algorithms: wc test.cpp wc... (1 Reply)
Discussion started by: guankin
1 Replies

4. UNIX for Dummies Questions & Answers

Cron job not working

cron process in AIX is there when I do ps -ef |grep cron, but none of cron job is working. It appears that cron process is hanging or having some issues? How do you resolve this? Do I kill the cron process by kill -9 PID? and how to start it? Please advise. (1 Reply)
Discussion started by: Daniel Gate
1 Replies

5. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

6. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

7. Solaris

cron not working.

I have a script monitor.sh the path is /netmon/bin/monitor.sh when i run this script as sh /netmon/bin/monitor.sh it runs completely fine. but when i include it in crontab , it does not run my cron entry is 0,5,10,15,20,25,30,35,40,45,50,55 * * * *... (11 Replies)
Discussion started by: asalman.qazi
11 Replies

8. UNIX for Dummies Questions & Answers

Cron not working

I created a file in /u01/oradata directory as cronjb.ksh which contains following script 30 12 * * * /export/home/oracle/u01/oradata/rman.ksh '/export/home/oracle' is my root directory. I then moved cronjb.ksh file to my '/export/home/oracle' directory. i typed crontab cronjb.ksh. However my... (1 Reply)
Discussion started by: manna
1 Replies

9. UNIX for Dummies Questions & Answers

Cron not working?

Hello I have a mac os x server machine that I have setup a cron to run a php file using wget and cron doesn't seem to work. I have setup cron on other mac's before and they have all worked. Also I know wget works because I have tested it. Is there anything else I should try? I do crontab -e and... (5 Replies)
Discussion started by: christo16
5 Replies

10. UNIX for Dummies Questions & Answers

cron not working

Cron does not seem to work with this crontab. Any ideas? # run-parts # commands to execute every hour 01 * * * * root run-parts /etc/cron.hourly # commands to execute every day 02 4 * * * root run-parts /etc/cron.daily # commands to execute every week 22 4 * * 0 root run-parts... (1 Reply)
Discussion started by: DaleCabell
1 Replies
Login or Register to Ask a Question