Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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*
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")?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.