Suse/NovellThis Forum is for the discussion of Suse Linux.
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.
For some reason when my CRON runs for my Oracle id, the environment variables don't appear to get passed. As an example, if I log in as Oracle and run a script that does the following
Depending on the version of cron that you run, it probably has a cut down environment to run your jobs in. Dillon's cron for example, only keeps the USER, HOME, and SHELL variables when running a user's job.
Using the full path to the commands used in the script and exporting the required environment variables in the script should allow it to run.
We have many scripts that will need to be ported from HP-UX. The problem is that we don't want to modify every script with the environment variable information that they each need. Obviously, the cron env is different from shell environment of the oracle user (or any user for that matter). Why is this, and how do I make the cron env to be the same as the user's shell env?
As an example...
If I do an 'env' in cron, I only get:
SHELL
PATH
PWD
HOME
SHLVL
LOGNAME
_
When I do an `env` in my shell, I get about 70 variables. Is there any way to get these variables visible in my cron? I can't get any of my scripts to run in cron. Thanks.
Unfortunately, not with the version of cron I'm using. It may be possible to create a file that holds your environment variables and source that at the top of each script. It does mean modifying each script still, but you could do it with sed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.