# Cron Job; unable to automate

**URL:** <https://help.nextcloud.com/t/cron-job-unable-to-automate/201859>\
**Category:** ℹ️ Support\
**Tags:** docker, nc28, cron, proxmox\
**Created:** [August 26, 2024, 10:04pm UTC](https://help.nextcloud.com/t/cron-job-unable-to-automate/201859 "2024-08-26T22:04:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyril\_Pinto](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cyril_pinto/32/54042_2.png) [@Cyril\_Pinto](https://help.nextcloud.com/u/Cyril_Pinto)\
**Post date:** [August 26, 2024, 10:04pm UTC](https://help.nextcloud.com/t/cron-job-unable-to-automate/201859/1 "2024-08-26T22:04:38Z")

</div>

Hi; recently installed NC on Proxmox in its own LXC using the following code:

services:  
db:  
image: mariadb:10.6  
restart: always  
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW  
volumes:  
- /mnt/ncdata/db:/var/lib/mysql  
environment:  
- PUID=1000  
- PGID=10000  
- MYSQL\_ROOT\_PASSWORD=  
- MYSQL\_PASSWORD=  
- MYSQL\_DATABASE=nextcloud  
- MYSQL\_USER=nextcloud

redis:  
image: redis:latest  
restart: always  
command: redis-server --requirepass abcd

app:  
image: nextcloud:28.0.9  
restart: always  
ports:  
- 8080:80  
links:  
- db  
- redis  
volumes:  
- /mnt/ncdata/nextcloud:/var/www/html  
environment:  
- PUID=1000  
- PGID=10000  
- MYSQL\_PASSWORD=  
- MYSQL\_DATABASE=nextcloud  
- MYSQL\_USER=nextcloud  
- MYSQL\_HOST=db  
- REDIS\_HOST=redis  
- REDIS\_HOST\_PASSWORD=

I’ve managed to remove all security warnings / errors; however am repeatedly seeing the message “Cron job last ran xxx hours ago”.

I was able to partly address this by manually running this command: docker exec -u www-data root\_app\_1 php -f cron.php

I execute the following and input the following four (4) commands however they don’t seem to be working.

crontab -u www-data -e

\*/5 \* \* \* \* docker exec -u www-data root\_app\_1 php -f cron.php  
\*/5 \* \* \* \* docker exec -u www-data root\_app\_1 php -f /mnt/ncdata/nextcloud/cron.php  
\*/5 \* \* \* \* php -f /mnt/ncdata/nextcloud/cron.php  
\*/5 \* \* \* \* php -f cron.php

In my desperation; I even added the following to /etc/php/8.2/mods-available:

apc.enable\_cli=1

* * *

Could anyone assist and let me know what i’m doing wrong here.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_449c533f586939b6e5f246632a46421f.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [August 27, 2024, 7:12pm UTC](https://help.nextcloud.com/t/cron-job-unable-to-automate/201859/2 "2024-08-27T19:12:14Z")

</div>

The cleanest way to run cron with the micro-services image is here:

> <https://github.com/nextcloud/docker/blob/e6d024039fefe3d32ad1337ab318365259a5510c/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml#L37>

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [November 25, 2024, 7:12pm UTC](https://help.nextcloud.com/t/cron-job-unable-to-automate/201859/3 "2024-11-25T19:12:24Z")

</div>

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