On Tue, May 28, 2019 at 05:43:03PM -0400, System Administrator wrote:
> On 28 May 2019 at 15:14, Carlos Aguilar wrote:
> 
> > Hi,
> > 
> > I am having lots of problems to execute a shell script at boot time.
> > 
> > My crontab is as follows;
> > >>
> > SHELL=/bin/ksh
> > 
> > @reboot         $HOME/bin/app-ferre
> > <<
> > My shell script is as follows:
> > >>
> > #!/bin/ksh
> > 
> > lua=/usr/local/bin/lua53
> > 
> > for f in $(ls /home/alberto/app/service-*.lua) ;do
> >     echo 'Initializing' $f '\n'
> >     $lua $f &
> > done
> > >>
> > 
> > Thanks for any help or advice,
> > 
> > // Carlos
> > 
> 
> Hi Carlos,
> 
> The $HOME environment variable is defined by the interactive shell for 
> login sessions. Moreover, unless you regularly log into your system as 
> root -- which is the user that kicks off cron tasks and runs them 
> unless changed with su or doas -- it does not point where you are 
> expecting (*your* home folder).
> 
> When specifying crontab entries, it is best to spell out the program 
> path.
> 
> -Jacob.

Assuming that this is being run from the correct users' crontab, $HOME
would be set correctly.  Cron sets $HOME.

There is too much information missing from the original post that it
makes it difficult to debug (any mentioning of what the actual issue is,
for example).

-- 
Kusalananda
Sweden

Reply via email to