Skip to main content

Nextcloud CLI (ooc) im Docker Container verwenden

Interaktiv in der Console

docker exec -it -u 33 nextcloud-app-1 /bin/bash

image.png

 

 

via Portainer

https://www.reddit.com/r/NextCloud/comments/croxkm/how_to_use_occ_scan_on_a_docker_install/

https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#using-the-occ-command

zuerst in den Docker container gehen (zb Portainer oder über Konsole) und folgendes Kommando testen:

php occ maintenance:mode --on

image.png 

image.png

evtl kommt folgende Fehlermeldung:

root@1dfd70a49980:/var/www/html# php occ maintenance:mode --on
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)

danach die Konsole des Containers nochmal starten, diesmal mit dem vorgeschlagenen Nutzer (user id 33 in meinem Fall, wie in der Ausgabe vorgeschlagen):

image.png

und dann

./occ maintenance:mode --on

oder wenn man kein portainer nutzt:

docker exec container_name sudo -u 33 php7 /var/www/html/occ files:scan --all

image.png

WICHTIG

auf den Ordner achten. Auszug aus dem reddit post (siehe oben)

With something like this, the path to occ is important. It's either under /config/www/nextcloud or /var/www/html.
Also, if you see occ but you can't run commands like so - occ files:scan <user> then ./occ files:scan <user> can sometimes fix it.

Interaktiv in der Console:

docker exec -it -u 33 nextcloud-app-1 /bin/bash

image.png