Cron does not run within CP

So I’m currently running a larval site and im running two cron commands.

I run them in the public_html folder
sudo php artisan app:sitemap-generate
sudo php artisan schedule:run
If i run both the commands within the CLI it works fine

Also if i run them like this in the CLI also works fine

now if i run the same commands in the hestiacp cron page it will not run

Don’t use sudo …

if i change it to
/home/username/web/website.com/public_html/artisan app:sitemap-generate

still the same not seeming to work

I use always:

cd /home/username/web/website.com/public_html/ && /home/username/web/website.com/public_html/artisan app:sitemap-generate

And never have an issue

its still the same not execution the command i will have to look into it more
to see if it my setup that’s stopping it

service cron status

If it is not running, then it needs to be started.

su user
and then run
cd /home/username/web/website.com/public_html/ && /usr/bin/php8.3 /home/username/web/website.com/public_html/artisan app:sitemap-generate

And it should work fine

1 Like

And that should be the cronjob as well…

no mater what way I enter it into the hestiacp i will not run

I have ended up using it with
crontab -e

          • sudo /home/username/web/website.com/public_html/artisan app:sitemap-generate

and that works i will leave it like this for now
thanks for all your help

Then you ru n the code as root. You don’t want to do that…

1 Like