Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions admin_manual/configuration_server/occ_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ occ command Directory
---------------------

* :ref:`http_user_label`
* :ref:`run_commands_in_maintenance_mode`
* :ref:`apps_commands_label`
* :ref:`background_jobs_selector_label`
* :ref:`config_commands_label`
Expand Down Expand Up @@ -186,6 +187,25 @@ you need to specify ``--program occ`` after the ``--generate-hook``.
If you want the completion to apply automatically for all new shell sessions, add the command to your
shell's profile (eg. ``~/.bash_profile`` or ``~/.zshrc``).

.. _run_commands_in_maintenance_mode:

Run commands in maintenance mode
--------------------------------

In maintenance mode, no apps are loaded [1]_.

Commands provided by apps are not available.

The commands, available in maintenance mode, are integrated in Nextcloud server.
A command may use events to communicate with other apps. An app can only react to an event when loaded.

Example: The command `user:delete` deletes a user account. UserDeletedEvent is emitted. Calendar app implements an event listener to delete user data [2]_. In maintenance mode, the Calendar app is not loaded, and hence the user data not deleted.

Consider running such commands with maintenance mode off.

.. [1] Exception: `The settings app is loaded <https://github.com/nextcloud/server/blob/75f17b60945e15effc3eea41393eef2b13937226/lib/base.php#L780>`_
.. [2] `Calendar app event listener for UserDeletedEvent <https://github.com/nextcloud/calendar/blob/87e8586971a8676dc15a90f0cd969274678b7009/lib/Listener/UserDeletedListener.php>`_

.. _apps_commands_label:

Apps commands
Expand Down Expand Up @@ -606,10 +626,7 @@ user::

sudo -u www-data php occ encryption:decrypt freda

Users must have enabled recovery keys on their Personal pages. You must first
put your Nextcloud server into :ref:`maintenance
mode <maintenance_commands_label>` to prevent any user activity until
decryption is completed.
Users must have enabled recovery keys on their Personal pages.

Note that if you do not have master key/recovery key enabled, you can ONLY
decrypt files per user, one user at a time and NOT when in maintenance mode.
Expand Down Expand Up @@ -1151,6 +1168,7 @@ This example restores the deleted files of users molly and freda::

User commands
-------------
.. note:: Read :ref:`run_commands_in_maintenance_mode` if you intend to use a user command in maintenance mode.

The ``user`` commands create and remove users, reset passwords, display a simple
report showing how many users you have, and when a user was last logged in::
Expand Down Expand Up @@ -1281,6 +1299,8 @@ authentication servers such as LDAP::
Group commands
--------------

.. note:: Read :ref:`run_commands_in_maintenance_mode` if you intend to use a group command in maintenance mode.

The ``group`` commands create and remove groups, add and remove users in
groups, display a list of all users in a group::

Expand Down