- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl Problem in Cron
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 02:07 PM
тАО07-28-2004 02:07 PM
Perl Problem in Cron
I've been solving this problem for days now and still i can't make it work. I have perl script that load data in our database. In the command line, i can successfully run my perl script via shell script. But, when i try to do it via cron then problem begins....
This is what i'm getting:
Can't exec "sqlldr": No such file or directory
I read this is caused by not properly setting the ENV.
How can i set my ENV right?
Do i need to add additional lines in my script? in shell? in perl? or in cron?
Pls. i need your help.
If my problem is already been discussed i would gladly apprciate if you post the thread link..
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 02:41 PM
тАО07-28-2004 02:41 PM
Re: Perl Problem in Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 02:57 PM
тАО07-28-2004 02:57 PM
Re: Perl Problem in Cron
Thanks for your quick reply.
Yes i read a lot of thread saying that i should include the PATH or ENV...but, how can i do it? should i do it i my perl script? or shell?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 03:30 PM
тАО07-28-2004 03:30 PM
Re: Perl Problem in Cron
export PATH=
Now you'll find that all Unix commands and programs cannot be found. When put commands like cut and awk and grep in a script, they can't be found unless the PATH crutch is available. So many sysadmins have forgotten about PATH that they don't really know where the command is located. Now change PATH to:
export PATH=/usr/bin
and now vi and grep and awk can be found. PATH is one of dozens of environment variables in your 'normal' login. cron does not login so it does not inherit any of these values. So restore your basic PATH value by typing:
export PATH=$(cat /etc/PATH)
Now to see your login environment, type the commands: set and env. The set command shows everything, env shows just the exported values. You can capture the env output and add it to your script. But the better way is to examine your script to see what it (and commands that you use in the script) needs. Then code those into your script.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 07:42 PM
тАО07-28-2004 07:42 PM
Re: Perl Problem in Cron
copy PATH from env
In crontab you have to allways setup path for everything. You you have output/input log config files they all have to be defined.
like this in example.
/u01/app/oracle/product/8.0.6/bin/sqlldr user/pass control=/dir/foo logfile=/dir/log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 08:58 PM
тАО07-28-2004 08:58 PM
Re: Perl Problem in Cron
I do not have . in my PATH.
$ ln -s /bin/ls ls_in_home_dir
$ perl
system("ls_in_home_dir");
Nothing happens (system call doesn't work cause not finding the program). Now I put . in PATH using ENV:
$ perl
$ENV{'PATH'}.=":.";
system("ls_in_home_dir");
bin
docs
log
ls_in_home_dir
scripts
That's all :)
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2004 09:04 PM
тАО07-28-2004 09:04 PM
Re: Perl Problem in Cron
I'd like to thank you all for your quick reply...
I already fixed the problem...finally!!
I just added these lines in my perl script
$ENV{ORACLE_BASE}='/oracle';
$ENV{ORACLE_SID}='cdsdbdev';
$ENV{ORACLE_HOME}='/oracle/app/product/10.1.0.2/db';
Thank you all!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2004 01:28 AM
тАО08-02-2004 01:28 AM
Re: Perl Problem in Cron
I have a script called ora_defaults that sets up the oracle environment. I source it at the beginning of all my scripts so that I know the environment is set up correctly.
example:
#!/usr/bin/ksh
. /home/oracle/ora_defaults
This saves you should your oracle home, oracle_sid, etc. should change.
BTW - Good name Allan
-Good Luck
Allan Hicks