Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to set profile for cron job

Status
Not open for further replies.

dmjoen

Technical User
Jul 26, 2001
31
US
I am trying to execute a script from the oracle users crontab. However, the script is failing due to the fact that the appropriate environment variables are not being set. Is there a way to get the oracle users profile read from a cron job? I am trying to avoid setting many variables in the script itself.
 
have you tried running
. /home/oracle/.profile
from the script? (Assuming /home/oracle is where the user's .profile is.)

But setting the environment in the script might make it easier to troubleshoot problems, rather than calling .profile.
 
I usually include these lines for crontabbed scripts regardless of if they are absolutely necessary:

. /etc/environment
. /etc/profile
. /home/oracle/.profile

(I use ksh for my scripting, adjust as appropriate)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top