Skip to content

Commit

Permalink
docs: document OCC commands
Browse files Browse the repository at this point in the history
closes #772

Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Sep 29, 2023
1 parent e10baec commit 151f1e9
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 3 deletions.
67 changes: 67 additions & 0 deletions docs/occ-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
description: Documentation for Memories OCC commands
---

# OCC commands

Memories provides several OCC commands for administration. For usage of the `occ` command line, refer [here](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) for more information.

!!! warning "OCCWeb"

The OCCWeb app is deprecated, and will not work with Memories. You must use the `occ` command line.

## `occ memories:index`

This is the basic command for indexing metadata in files. You don't need to run this in a cron job since this is handled as a background job automatically. You can use the index command to speed up indexing if you just installed the app or if you have a lot of files that are not indexed yet.

!!! tip "Indexing in parallel"

You can run multiple processes of indexing in parallel, e.g. `for i in {1..4}; do (occ memories:index &); done`. This will speed up indexing significantly.

```
Usage:
memories:index [options]
Options:
-u, --user=USER Index only the specified user
-g, --group=GROUP Index only specified group
--folder=FOLDER Index only the specified folder (relative to the user's root)
-f, --force Force refresh of existing index entries
--clear Clear all existing index entries
--skip-cleanup Skip cleanup step (removing index entries with missing files)
```

!!! info "Re-indexing"

Running the command again will NOT reindex everything. It will only index new files and update the index for changed files.
If you really want to reindex everything, use the `--force` option or `--clear` to truncate all Memories tables before the index.

## `occ memories:places-setup`

Download and index the planet database. The planet database is the border map of the entire world and is used for reverse geocoding (not for the map). To use reverse geocoding, MySQL or Postgres is required.

```
Usage:
memories:places-setup [options]
Options:
-r, --recalculate Only recalculate places for existing files
```

## `memories:migrate-google-takeout`

Migrate Google Takeout JSON metadata to the files as EXIF data.

```
Usage:
memories:migrate-google-takeout [options]
Options:
-o, --override Override existing EXIF metadata
-u, --user=USER Migrate only for the specified user
-f, --folder=FOLDER Migrate only for the specified folder
```

!!! warning "Updates to files"

This command will modify the files in the user's data directory. Make sure you have a backup!
6 changes: 3 additions & 3 deletions lib/Command/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ protected function configure(): void
{
$this
->setName('memories:index')
->setDescription('Generate photo entries')
->setDescription('Index the metadata in files')
->addOption('user', 'u', InputOption::VALUE_REQUIRED, 'Index only the specified user')
->addOption('group', 'g', InputOption::VALUE_REQUIRED, 'Index only specified group')
->addOption('folder', null, InputOption::VALUE_REQUIRED, 'Index only the specified folder (relative to the user\'s root)')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force refresh of existing index entries')
->addOption('clear', null, InputOption::VALUE_NONE, 'Clear all existing index entries')
->addOption('skip-cleanup', null, InputOption::VALUE_NONE, 'Skip cleanup step')
->addOption('group', 'g', InputOption::VALUE_REQUIRED, 'Index only specified group')
->addOption('skip-cleanup', null, InputOption::VALUE_NONE, 'Skip cleanup step (removing index entries with missing files)')
;
}

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ nav:
- 'hw-transcoding.md'
- 'troubleshooting.md'
- 'system-config.md'
- 'occ-commands.md'
- Support:
- 'faq.md'
- 'changelog.md'
Expand Down

0 comments on commit 151f1e9

Please sign in to comment.