Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin): Update commands for files namespace #12387

Merged
merged 1 commit into from
Nov 25, 2024
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
31 changes: 19 additions & 12 deletions admin_manual/occ_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -773,18 +773,23 @@ to synchronize federated servers::
File operations
---------------

``occ`` has three commands for managing files in Nextcloud::

files
files:cleanup Cleanup filecache
files:repair-tree Try and repair malformed filesystem tree structures
files:scan Rescan filesystem
files:scan-app-data Rescan the AppData folder
files:transfer-ownership All files' and folders' ownerships are moved to another
user. Outgoing shares are moved as well.
Incoming shares are not moved by default because the
sharing user holds the ownership of the respective files.
There is however an option to enable moving incoming shares.
Available ``occ`` commands for the ``files`` namespace::

files:cleanup cleanup filecache
files:copy Copy a file or folder
files:delete Delete a file or folder
files:get Get the contents of a file
files:move Move a file or folder
files:object:delete Delete an object from the object store
files:object:get Get the contents of an object
files:object:put Write a file to the object store
files:put Write contents of a file
files:recommendations:recommend
files:reminders List file reminders
files:repair-tree Try and repair malformed filesystem tree structures
files:scan rescan filesystem
files:scan-app-data rescan the AppData folder
files:transfer-ownership All files and folders are moved to another user - outgoing shares and incoming user file shares (optionally) are moved as well.

.. _occ_files_scan_label:

Expand Down Expand Up @@ -925,6 +930,8 @@ In this case no sub-directory is created and all files will appear directly in t
It is also possible to transfer only one directory along with its contents. This can be useful to restructure your organization or quotas. The ``--path`` argument is given as the path to the directory as seen from the source user::

sudo -u www-data php occ files:transfer-ownership --path="path_to_dir" <source-user> <destination-user>

Incoming shares are not moved by default because the sharing user holds the ownership of the respective files. There is however an option to enable moving incoming shares.

In case the incoming shares must be transferred as well, use the argument ``--transfer-incoming-shares`` with ``0`` or ``1`` as parameters ::

Expand Down