LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-14-2007, 10:43 AM   #1
Argo
LQ Newbie
 
Registered: Jul 2006
Location: Canada
Distribution: Red Hat, CentOS, Fedora
Posts: 11

Rep: Reputation: 0
Cron and adding Paths


Good afternoon,

Just a simple question I have to ask, spent all morning searching and can't seem to find what I'm looking for.

I'm running a Red Hat server and need to add to new Paths to cron. I have a perl script that needs to interface with my oracle DB, but it is complaining that oracle_home is not set
*log snip*
Subject: Cron <root@**> /home/agrg/bin/agrg.sh
X-Cron-Env: <mailto=netadmin@***>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

ORACLE_HOME environment variable not set!
DBI connect('hail','**',...) failed: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) at /home/agrg/bin/agrg_DAT_parser.pl line 114


I was searching and found out about editing the /etc/crontab file. So I went ahead and did that, by adding ORACLE_HOME and other paths vars I believed I would need, then restarted crond. But they did not seem to take. When the job runs I get the same output as above.

I know if I add the ORACLE_HOME var to the actual cron file in /etc/cron.d it will work, but I'm kinda wondering where you can add it so it will affect all jobs, I don't want to have to update every cron job if I make a change on the server.

* I have been searching this forum and some others but with no luck, but that's not to say I'm just blinded today and missed it*

Thanks for your time.

Last edited by Argo; 03-14-2007 at 12:47 PM.
 
Old 03-15-2007, 04:41 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Do you want to affect all jobs of root, or all jobs of all users?
And where did you put the jobs? In /etc/cron.hourly, cron.daily, cron.weekly, cron.monthly? In /etc/cron.d?
Or just in the cron spool (via "crontab -e")?
 
Old 03-15-2007, 06:19 AM   #3
Argo
LQ Newbie
 
Registered: Jul 2006
Location: Canada
Distribution: Red Hat, CentOS, Fedora
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by timmeke
Do you want to affect all jobs of root, or all jobs of all users?
And where did you put the jobs? In /etc/cron.hourly, cron.daily, cron.weekly, cron.monthly? In /etc/cron.d?
Or just in the cron spool (via "crontab -e")?

I have all of my cron jobs in /etc/cron.d, and yes I wish for this change to reflect in all the users.

Basicly I'm just looking for the master file that cron uses for paths so I only have to make changes in one spot, rather then a dozen. I thought it was going to be my /etc/crontab file, but when I added the paths to that (such as ORACLE_HOME=/path/to/oracle) and restarted cron it did not reflect changes.
I was going to use 'crontab -e' and put them in there, but the very first line of it says 'DO NOT EDIT THIS FILE - edit the master and reinstall.' and I'm not really to keen on editing something that may force an OS reinstall.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
adding new cron job via web Bake-SaleNet Linux - Software 3 04-07-2004 06:31 AM
Adding Paths scottie Linux - Newbie 1 12-03-2003 08:34 AM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM
Adding Paths in Redhat 8.0 Fantmx Linux - Newbie 2 04-04-2003 08:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration