Frequently Asked Question

occ occ maintenance (maintenance operations)
Last Updated 3 hours ago

occ occ maintenance (maintenance operations)

Maintenance Mode Commands

The following OCC commands control maintenance mode and related tasks. Use them from the command line as the web‑server user (usually www-data).

Enable maintenance mode

sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --on
  • All HTTP requests are blocked except for health‑check URLs.
  • Use before upgrades, migrations or other disruptive operations.

Disable maintenance mode

sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --off
  • Restores normal operation once the maintenance task is complete.

Run repair steps

sudo -u www-data php /path/to/nextcloud/occ maintenance:repair
  • Repairs database inconsistencies, file locks and other integrity issues.
  • Run after encountering errors during an upgrade or after manual file changes.

Update the .htaccess file

sudo -u www-data php /path/to/nextcloud/occ maintenance:update:htaccess
  • Generates a fresh .htaccess with the latest security rules.
  • Helpful after changing server configuration or when adding new rewrite rules.

Run the upgrade process

sudo -u www-data php /path/to/nextcloud/occ upgrade
  • Executes the core upgrade routine after you have pulled the latest code.
  • Ensure maintenance mode is enabled first, then run this command.
This FAQ was generated and/or edited by GAIN, GENs Artificial Intelligence Network and should not be considered 100% accurate. Always check facts and do your research, things change all the time. If you are unsure about any information provided, please raise a support ticket for clarification.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...