Computing.Net > Forums > Linux > Problem with Cron

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Problem with Cron

Reply to Message Icon

Name: Vladan
Date: October 25, 2002 at 13:34:52 Pacific
OS: Red Hat 7.2
CPU/Ram: 512M
Comment:

I have a problem with cron that runs export utility (exp) from oracle/bin.
When I put in shell script "copy" command,cron works! But,when I want to run exp utiluty,it does not work!
Should I put some PATH, or something else?



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: October 25, 2002 at 13:45:12 Pacific
Reply:

Yes you have a path problem. Easy to check. Put a line like

echo $PATH

at the start of your script and look at the result the next time it runs.

easy to fix

PATH=$PATH:/path/to/oracle/bin/
or
execute the exp executable with a full path name.


0

Response Number 2
Name: Kenan Bektas
Date: October 25, 2002 at 15:05:47 Pacific
Reply:

Make sure you have a line below at the beginning
of export script.

#!/bin/sh
...


0

Response Number 3
Name: Sean Miller
Date: October 25, 2002 at 22:50:50 Pacific
Reply:

$ORACLE_HOME/bin/exp ....

Sean


0

Response Number 4
Name: zaxxon
Date: October 27, 2002 at 09:48:07 Pacific
Reply:

You should set all your environment variables within the script that is being called by cron. For an oracle export these should include ORACLE_HOME, ORACLE_SID, and make sure PATH has your oracle bin directory in it. If this is a unicode database you should also set NLS_LANG. Now here's the trick when you call the script from your crontab file make sure you call it with a '. scriptfile' notice the .filename. This is to make sure that the environment variables that you setup within the script will be available.


0

Response Number 5
Name: zaxxon
Date: October 27, 2002 at 10:14:09 Pacific
Reply:

in my previous thread it is not obvious that you need a space after the '.' and before the script name in the crontab file. (just to clarify)


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Cannot see linux from win... Free Linux Download?



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Problem with Cron

User Cron Problem www.computing.net/answers/linux/user-cron-problem/14805.html

problems with ppp www.computing.net/answers/linux/problems-with-ppp/16205.html

problem with videocard in linux redhat www.computing.net/answers/linux/problem-with-videocard-in-linux-redhat/6062.html