(I tried other modifications that I could find on the Internet, the result is the same everywhere, it does not work)
I’ll also immediately add a second question that may arise.
There are two containers running on the machine with nextcloud. How can I add its execution to the second connector? Do not really understand. New to these things…
Your cron entry is wrong. First try on the command line if it works, then put it in cron.
I never used sudo in cron commands, but depending on your configuration that might not work. If you need root rights, then put it in the root crontab.
Your command executes it in container “nextcloud”. If you have a second container, it will have a different name which you should use.
docker exec -it CONTAINERNAME crontab -e -u www-data should open your crontab, then put there */5 * * * * php -f /var/www/html/cron.php
Or do it like here: Docker setup & cron - #7 by lazmol
make sure the location of cron.php is /var/www/html or /var/www/html/apps.
add user www-data to docker group.
modify your cron entry to:
*/5 * * * * docker exec -u www-data [your-nextcloud-container] php [your-cron.php-location]
I did these and it worked
add to your nextcloud section of compose-file:
“links:
- postgres-nextcloud
- redis-nextcloud (if you use redis)”