# Cron does not run within CP

**URL:** <https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953>\
**Category:** Cron Jobs\
**Created:** [December 10, 2024, 11:09am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953 "2024-12-10T11:09:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewart85](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stewart85/32/7748_2.png) [@stewart85](https://forum.hestiacp.com/u/stewart85)\
**Post date:** [December 10, 2024, 11:09am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/1 "2024-12-10T11:09:28Z")

</div>

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

 ![Screenshot 2024-12-10 110606](https://forum.hestiacp.com/uploads/default/original/2X/1/12e8440b750d2bb8246d7fe664c7c2a181c1b323.jpeg)

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

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 10, 2024, 11:10am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/2 "2024-12-10T11:10:15Z")

</div>

Don’t use sudo …

---

<div class="post-metadata">

**Author:** ![stewart85](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stewart85/32/7748_2.png) [@stewart85](https://forum.hestiacp.com/u/stewart85)\
**Post date:** [December 10, 2024, 11:17am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/3 "2024-12-10T11:17:22Z")

</div>

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

still the same not seeming to work

 ![Screenshot 2024-12-10 111607](https://forum.hestiacp.com/uploads/default/original/2X/6/6de925d7a88b2dc7472db91bd7ca51b9b43ac821.png)

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 10, 2024, 11:22am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/4 "2024-12-10T11:22:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stewart85](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stewart85/32/7748_2.png) [@stewart85](https://forum.hestiacp.com/u/stewart85)\
**Post date:** [December 10, 2024, 11:42am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/5 "2024-12-10T11:42:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon85655380](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@anon85655380](https://forum.hestiacp.com/u/anon85655380)\
**Post date:** [December 10, 2024, 12:38pm UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/6 "2024-12-10T12:38:19Z")

</div>

service cron status

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

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 10, 2024, 12:40pm UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/7 "2024-12-10T12:40:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 10, 2024, 5:01pm UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/8 "2024-12-10T17:01:05Z")

</div>

And that should be the cronjob as well…

---

<div class="post-metadata">

**Author:** ![stewart85](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stewart85/32/7748_2.png) [@stewart85](https://forum.hestiacp.com/u/stewart85)\
**Post date:** [December 11, 2024, 11:28am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/9 "2024-12-11T11:28:35Z")

</div>

> [@eris](#):
>
> cd /home/username/web/website.com/public\_html/ && /usr/bin/php8.3 /home/username/web/website.com/public\_html/artisan app:sitemap-generate

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

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 11, 2024, 11:38am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/10 "2024-12-11T11:38:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.hestiacp.com/uploads/default/original/1X/d9a5b68bf50ced83e880b56452e592b204761b19.png) [@system](https://forum.hestiacp.com/u/system)\
**Post date:** [January 10, 2025, 11:38am UTC](https://forum.hestiacp.com/t/cron-does-not-run-within-cp/16953/11 "2025-01-10T11:38:46Z")

</div>

Closed on January 10, 2025, 11:38am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
