[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crontab running scripts



On Thu, May 31, 2001 at 04:50:53AM +0200, Andr? Borman wrote:
> I would like to know how I can get e.g. this crontab entry
> * * * * * /usr/local/bin/foo -options arg1 arg2
> to run right.

> options and arguments. It seems that when foo is executed, the external
> programs are not executed because they're not in the path. When I include
> the absolute paths in the script everything works fine, but that's not
> really satisfying.

> I thought 
> * * * * * /bin/bash foo -options arg1 arg2 
> might do it because the path is defined somewhere in the bash config,
> right? But it doesn't work.

Bash doesn't it normally doesn't normally execute any startup scripts
(unless BASH_ENV is set, see the manual page.) You could run in with the
--login option:

* * * * * /bin/bash --login foo -options arg1 arg2

which will make it read the .rc files; you could also put an 'EXPORT PATH='
line near the beginning of you script, this will eliminate having to type
the paths over for each line.

-- 
Harry Henry Gebel
West Dover Hundred, Delaware
GPG encrypted email gladly accepted. Key ID: B853FFFE
Fingerprint: 15A6 F58D AEED 5680 B41A  61FE 5A5F BB51 B853 FFFE

Attachment: pgpsc8KBYoOLy.pgp
Description: PGP signature


Reply to: