From 9dd2108791c86dc35fc3fe830791dfac7913ba7a Mon Sep 17 00:00:00 2001 From: Matthew Setter Date: Wed, 15 May 2019 12:01:29 +0200 Subject: [PATCH 1/2] Document the changes to the maintenance:repair command This fixes #946. --- .../configuration/server/occ_command.adoc | 47 ++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/modules/admin_manual/pages/configuration/server/occ_command.adoc b/modules/admin_manual/pages/configuration/server/occ_command.adoc index 98ca83a4e5..72673ed20d 100644 --- a/modules/admin_manual/pages/configuration/server/occ_command.adoc +++ b/modules/admin_manual/pages/configuration/server/occ_command.adoc @@ -1994,20 +1994,55 @@ that one or more files were modified. After the command completes, users will be prompted to resolve any conflicts between newer and older file versions. +==== Installation Repair Commands + The `maintenance:repair` command runs automatically during upgrades to clean up the database, so while you can run it manually there usually isn't a need to. +===== Repair Command Options + +The `maintenance:repair` command supports the following options: + +[cols="25%,75%",options="header"] +|=== +|Option +|Description +a|`--ansi` +|Force ANSI output. +a|`--include-expensive` +|Use this option when you want to include resource and load expensive tasks. +a|`--no-ansi` +|Disable ANSI output. +a|`-n` `--no-interaction` +|Do not ask any interactive question. +a|`--no-warnings` +|Skip global warnings, show command output only. +a|`-q` `--quiet` +|Do not output any message. +a|`-s` `--single=SINGLE` +|Run just one repair step given its class name. +a|`-V` `--version` +|Display this application version. +a|`-v\|vv\|vvv` `--verbose` +a|Increase the verbosity of messages: + +* 1 for normal output +* 2 for more verbose output and 3 for debug +|=== + +Here is an example of running the command: + +[source,console] .... sudo -u www-data php occ maintenance:repair .... -`maintenance:mimetype:update-db` updates the ownCloud database and file -cache with changed mimetypes found in `config/mimetypemapping.json`. Run -this command after modifying `config/mimetypemapping.json`. If you -change a mimetype, run -`maintenance:mimetype:update-db --repair-filecache` to apply the change -to existing files. +=== Mimetype Update Commands + +`maintenance:mimetype:update-db` updates the ownCloud database and file cache with changed mimetypes found in `config/mimetypemapping.json`. +Run this command after modifying `config/mimetypemapping.json`. +If you change a mimetype, run `maintenance:mimetype:update-db --repair-filecache` to apply the change to existing files. [[config-reports]] === Config Reports From 5bb58e25e26bed7d22ba6cfffe8f94f1416d4b92 Mon Sep 17 00:00:00 2001 From: Matthew Setter Date: Wed, 15 May 2019 12:01:29 +0200 Subject: [PATCH 2/2] Document the changes to the maintenance:repair command This fixes #946. --- .../configuration/server/occ_command.adoc | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/modules/admin_manual/pages/configuration/server/occ_command.adoc b/modules/admin_manual/pages/configuration/server/occ_command.adoc index 72673ed20d..485b25a30b 100644 --- a/modules/admin_manual/pages/configuration/server/occ_command.adoc +++ b/modules/admin_manual/pages/configuration/server/occ_command.adoc @@ -1996,9 +1996,11 @@ versions. ==== Installation Repair Commands -The `maintenance:repair` command runs automatically during upgrades to -clean up the database, so while you can run it manually there usually -isn't a need to. +The `maintenance:repair` command helps administrators repair an installation. +The command runs automatically during upgrades to clean up the database. +So, while you can run it manually, there usually isn't a need to. + +NOTE: Your ownCloud installation needs to be in maintenance mode to use the `maintenance:repair` command. ===== Repair Command Options @@ -2012,6 +2014,8 @@ a|`--ansi` |Force ANSI output. a|`--include-expensive` |Use this option when you want to include resource and load expensive tasks. +a|`--list` +|Lists all possible repair steps a|`--no-ansi` |Disable ANSI output. a|`-n` `--no-interaction` @@ -2038,6 +2042,42 @@ Here is an example of running the command: sudo -u www-data php occ maintenance:repair .... +To list all off the possible repair steps, use the `--list` option. +It should output the following list to the console: + +.... +Found 16 repair steps + +OC\Repair\RepairMimeTypes -> Repair mime types +OC\Repair\RepairMismatchFileCachePath -> Detect file cache entries with path that does not match parent-child relationships +OC\Repair\FillETags -> Generate ETags for file where no ETag is present. +OC\Repair\CleanTags -> Clean tags and favorites +OC\Repair\DropOldTables -> Drop old database tables +OC\Repair\DropOldJobs -> Drop old background jobs +OC\Repair\RemoveGetETagEntries -> Remove getetag entries in properties table +OC\Repair\RepairInvalidShares -> Repair invalid shares +OC\Repair\RepairSubShares -> Repair sub shares +OC\Repair\SharePropagation -> Remove old share propagation app entries +OC\Repair\MoveAvatarOutsideHome -> Move user avatars outside the homes to the new location +OC\Repair\RemoveRootShares -> Remove shares of a users root folder +OC\Repair\RepairUnmergedShares -> Repair unmerged shares +OC\Repair\DisableExtraThemes -> Disable extra themes +OC\Repair\OldGroupMembershipShares -> Remove shares of old group memberships +OCA\DAV\Repair\RemoveInvalidShares -> Remove invalid calendar and addressbook shares +.... + +===== Running a Single Repair Step + +To run a single repair step, use either the `-s` or `--single` options, as in the following example. + +[source,console] +.... +sudo -u www-data php occ maintenance:repair --single="OCA\DAV\Repair\RemoveInvalidShares" +.... + +TIP: The step's name must be quoted, otherwise you will see the following warning message appear, and the command will fail: +"_Repair step not found. Use --list to show available steps._" + === Mimetype Update Commands `maintenance:mimetype:update-db` updates the ownCloud database and file cache with changed mimetypes found in `config/mimetypemapping.json`.