Skip to content

Commit f968682

Browse files
committed
docs: fix stale and inaccurate occ command documentation
- Rename "Run occ as your HTTP user" to "Running occ" with explanation of why the HTTP user is needed - Rename "Run commands in maintenance mode" to "Limitations in maintenance mode" to accurately reflect the section content - Fix environment variables section: both examples were identical, now shows inline variable and export as separate approaches - Update background jobs: cron is the primary command, list all three modes in the command listing - Remove db:generate-change-script (removed from server in nextcloud/server#5772) - Add note that antivirus commands require the files_antivirus app AI-Assisted-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 2bf1f12 commit f968682

1 file changed

Lines changed: 23 additions & 17 deletions

File tree

admin_manual/occ_command.rst

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ occ command Directory
5252

5353
.. _http_user_label:
5454

55-
Run occ as your HTTP user
56-
-------------------------
55+
Running occ
56+
-----------
57+
58+
You must run ``occ`` as your HTTP user so that the file ownership and permissions
59+
on your Nextcloud data directory stay consistent with the web server.
5760

5861
The HTTP user is different on the various Linux distributions:
5962

@@ -170,13 +173,15 @@ and ``encryption:list-modules``
170173
Environment variables
171174
^^^^^^^^^^^^^^^^^^^^^
172175

173-
``sudo`` does not forward environment variables by default. Put the variables before the ``php`` command::
176+
``sudo`` does not forward environment variables by default. You can prepend the
177+
variable and use the ``-E`` switch to pass it through::
174178

175179
NC_debug=true sudo -E -u www-data php occ status
176180

177-
Alternatively, you can ``export`` the variable or use the ``-E`` switch for ``sudo``::
181+
Alternatively, ``export`` the variable first::
178182

179-
NC_debug=true sudo -E -u www-data php occ status
183+
export NC_debug=true
184+
sudo -E -u www-data php occ status
180185

181186
Enabling autocompletion
182187
-----------------------
@@ -206,7 +211,7 @@ shell's profile (eg. ``~/.bash_profile`` or ``~/.zshrc``).
206211

207212
.. _run_commands_in_maintenance_mode:
208213

209-
Run commands in maintenance mode
214+
Limitations in maintenance mode
210215
--------------------------------
211216

212217
In maintenance mode, apps are not loaded [1]_, so commands from apps are unavailable. Commands integrated into Nextcloud server are available in maintenance mode.
@@ -323,23 +328,23 @@ To update an app to an unstable release, for instance News::
323328
Background jobs selector
324329
------------------------
325330

326-
Use the ``background`` command to select which scheduler you want to use for
327-
controlling background jobs, Ajax, Webcron, or Cron. This is the same as using
331+
Use the ``background`` commands to select which scheduler you want to use for
332+
controlling background jobs. This is the same as using
328333
the **Cron** section on your Nextcloud Admin page::
329334

330335
background
331-
background:ajax Use ajax to run background jobs
332-
background:cron Use cron to run background jobs
333-
background:webcron Use webcron to run background jobs
336+
background:cron Set background jobs to cron mode
337+
background:ajax Set background jobs to ajax mode
338+
background:webcron Set background jobs to webcron mode
334339

335-
This example selects Ajax::
340+
Example::
336341

337-
sudo -E -u www-data php occ background:ajax
338-
Set mode for background jobs to 'ajax'
342+
sudo -E -u www-data php occ background:cron
343+
Set mode for background jobs to 'cron'
339344

340345
The other two commands are:
341346

342-
* ``background:cron``
347+
* ``background:ajax``
343348
* ``background:webcron``
344349

345350
See :doc:`configuration_server/background_jobs_configuration` to learn more.
@@ -796,8 +801,6 @@ convert from SQLite to one of these other databases.
796801
db
797802
db:convert-type Convert the Nextcloud database to the newly
798803
configured one
799-
db:generate-change-script generates the change script from the current
800-
connected db to db_structure.xml
801804

802805
You need:
803806

@@ -2245,6 +2248,9 @@ invisible No No
22452248
Antivirus
22462249
---------
22472250

2251+
.. note::
2252+
These commands require the `files_antivirus <https://apps.nextcloud.com/apps/files_antivirus>`_ app to be installed and enabled.
2253+
22482254
Get info about files in the scan queue::
22492255

22502256
sudo -E -u www-data php occ files_antivirus:status [-v]

0 commit comments

Comments
 (0)