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.
No comments:
Post a Comment