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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cronjob

Status
Not open for further replies.

bcre3306

MIS
May 7, 2002
45
US
I need to run a cronjob. The only problem I'm having is that I need to to run under a certain account because that account has certain variable for the job to run(oracle). Anybody have any suggestions on how to get this to work? Basically if I login under my oracle account and run the job manually it works fin, if I run it from cron it fails because the variables for the account are not loaded.
Thanks
 
The way one of our Oracle jobs is set up to run from the root cron is as follows:

00 21 * * 0 su - <oracleuser> -c &quot;<path to script>&quot;

This makes sure that the appropriate PATH variables etc are picked up and used when running the job in question.

Another way of doing this might be to include the variables explicitly within the script itself.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top