Merge pull request #10638 from nextcloud/backport/10637/stable27

[stable27] feat(adminmanual): Document how to use occ with sudo and env vars
This commit is contained in:
Marcel Müller 2023-06-16 12:10:14 +02:00 committed by GitHub
commit d40500f07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,6 +161,17 @@ This output option is available on all list and list-like commands:
``status``, ``check``, ``app:list``, ``config:list``, ``encryption:status``
and ``encryption:list-modules``
Environment variables
^^^^^^^^^^^^^^^^^^^^^
``sudo`` does not forward environment variables by default. Put the variables before the ``php`` command::
sudo -u www-data NC_debug=true php occ status
Alternatively, you can ``export`` the variable or use the ``-E`` switch for ``sudo``::
NC_debug=true sudo -E -u www-data php occ status
Enabling autocompletion
-----------------------