> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# mirror

> Configure and run a data mirroring job between a source and target Trino table.

The `mirror` command submits a job to a Kyuubi server.

```bash theme={null}
nx1 mirror \
  --mode <append|overwrite|merge> \
  --name <mirroring_job_name> \
  --source-catalog <source_catalog> \
  --source-schema <source_schema> \
  --source-table <source_table> \
  --target-catalog <target_catalog> \
  --target-schema <target_schema> \
  --target-table <target_table>
```

<Accordion title="Options">
  * `--merge-keys` `string` **optional**: Comma-separated columns used to match and merge data when the `mode` is `merge`.
  * `--mode` `string` **required**: How to write data to the table. Values: `append`, `overwrite`, or `merge`.
  * `--name` `string` **required**: Name of the data mirroring job.
  * `--schedule` `string` **optional**: Cron expression that specifies when or how often the mirroring runs.
  * `--source-catalog` `string` **required**: Source Trino catalog for the mirror.
  * `--source-schema` `string` **required**: Source schema for the mirror.
  * `--source-table` `string` **required**: Source table for the mirror.
  * `--target-catalog` `string` **required**: Target Trino catalog for the mirror.
  * `--target-schema` `string` **required**: Target schema for the mirror.
  * `--target-table` `string` **required**: Target table for the mirror.
</Accordion>

<Accordion title="Global options">
  * `--api-key` `string` **optional**: API key or the `NX1_API_KEY` variable.
  * `--config-file` `string` **optional**: YAML config file.
  * `--help` `-h` **optional**: Shows help messages and exit.
  * `--host` `string` **optional**: API host.
  * `--no-verify-ssl` **optional**: Disables SSL verification.
  * `--output` `-o` **optional**: Output format. Allowed values: `json`, `yaml`, or `table`.
  * `--profile` `-p` `string` **optional**: Profile name from `~/.nx1/profiles`.
  * `--timeout` `integer` **optional**: Requests when to timeout. Default is `30`.
  * `--verbose` `-v` **optional**: Verbose output.
</Accordion>
