Inheriting proper env for crontab
- From: "dn.perl@xxxxxxxxx" <dn.perl@xxxxxxxxx>
- Date: Tue, 17 Jul 2007 20:58:45 -0000
When I login as 'scott' , I can successfully execute a shell-script
which calls 'sqlplus' command from it. But I am unable to execute it
as cron job because sqlplus does not execute properly.
I logged in as 'scott', and added the following line to crontab :
5 * * * * full_path/my_cmd param1 param2
But it does not work.
I get the error : ORA-07217 : sltln: environemnt variable cannot be
evaluated.
So I modified crontab entry to :
5 * * * * /usr/bin/su scott -c full_path/my_cmd param1 param2
This generates the error : su : Sorry.
Presumably it expects the user's (scott's) password to be supplied.
So I logged in as root and added an entry to crontab :
5 * * * * /usr/bin/su scott -c full_path/my_cmd param1 param2
This has better success but when I executes my_cmd, it does not find
the command sqlplus because sqlplus is not in its PATH .
So I logged in as root and added an entry to crontab :
5 * * * * /usr/bin/su scott -c full_path/interm_script
Then in this intermediate_script, I exported PATH=$PATH:/apps/oracle/
bin
This has better success because sqlplus is now in its PATH . But I
still get the error :
Message file sp1<lang>.msb not found.
Error 6 initializing SQL*Plus.
Ideally I would like to manipulate just my own crontab, instead of the
root's crontab. But even if the root can set up a proper cronjob, I
will be happy.
Please advise. Thanks in advance.
.
- Follow-Ups:
- Re: Inheriting proper env for crontab
- From: Bit Twister
- Re: Inheriting proper env for crontab
- From: troyl
- Re: Inheriting proper env for crontab
- Prev by Date: Re: scp: disable overwriting of target file?
- Next by Date: Re: Inheriting proper env for crontab
- Previous by thread: scp: disable overwriting of target file?
- Next by thread: Re: Inheriting proper env for crontab
- Index(es):
Relevant Pages
|