Cron job for nextcloud

I’ve setup a cron job for nextcoud on the nextcloud container but apperently this is not fired

:/var/www/html# crontab -l -u www-data
*/5 * * * * php -f /var/www/html/cron.php

Yet in the settings

image

How would I activate proper a crontab entry for the Nextcloud cron?

If I connect to the container and run

su www-data php /var/www/html/cron.php

I get

This account is currently not available.

See:

Thanks! what would be the occ command to be ran?

docker compose exec --user www-data app php occ

no configuration file provided: not found

or

docker exec --user www-data nextcloud occ

or

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.49/containers/nextcloud/json”: dial unix /var/run/docker.sock: connect: permission denied

or

sudo docker exec --user www-data nextcloud occ

OCI runtime exec failed: exec failed: unable to start container process: exec: “occ”: executable file not found in $PATH: unknown

but

sudo docker exec -it nextcloud /var/www/html/occ

Nextcloud 31.0.4

Usage:
command [options] [arguments]

Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
–ansi|–no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
–no-warnings Skip global warnings, show command output only
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

the later seems promising (but was not documented)

how do I start the suggested cron process ?

I scheduled a job on the docker host with:

*/10 * * * * sudo docker exec -u www-data nextcloud php /var/www/html/cron.php

The nextcloud server runs in a container called “nextcloud”.

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