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.
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.
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.
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.
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 :
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?