CLI Reference
Every GoArchive command and option.
goarchive <command> [flags]
Commands
| Command | Description |
|---|---|
| archive | Copy data to the destination, then remove it from the source |
| copy-only | Copy data to the destination without removing anything |
| purge | Remove data from the source without copying it |
| dry-run | Preview a job, including estimated row counts |
| validate | Check the configuration and the environment |
| plan | Display table relationships and processing order |
| list-jobs | List the jobs defined in a configuration file |
| version | Show version information |
Global flags
Available on every command.
| Flag | Description | Default |
|---|---|---|
-c, --config <path> | Configuration file to read | archiver.yaml |
--log-level <level> | debug, info, warn, or error | from configuration |
--log-format <format> | json or text | from configuration |
--skip-verify | Skip verification after copying | off |
Batch sizes and pacing are set in the configuration file rather than on the command line, so that a file holding several jobs can give each the settings it needs.
archive
Copies data to the destination, verifies it, and removes it from the source.
goarchive archive -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | The job to run |
--force | Proceed when a previous run left a stale lock, after confirming that run has ended |
--force-triggers | Proceed when source tables have deletion triggers |
--skip-validate-preflight | Skip the environment checks that normally run first |
See Archiving Data .
copy-only
Copies data to the destination and leaves the source untouched.
goarchive copy-only -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | The job to run |
--force | Proceed when a previous run left a stale lock |
--skip-validate-preflight | Skip the environment checks that normally run first |
See Copying Without Deleting .
purge
Removes data from the source without copying it.
goarchive purge -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | The job to run |
--force | Proceed when a previous run left a stale lock |
--force-triggers | Proceed when source tables have deletion triggers |
--skip-validate-preflight | Skip the environment checks that normally run first |
See Purging Data .
dry-run
Previews a job without changing anything.
goarchive dry-run -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | The job to preview |
Reports the filter, the rows each table would contribute, and whether the configured batch size fits the destination’s limits.
validate
Checks the configuration and both servers.
goarchive validate -c archiver.yaml
goarchive validate -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | Check one job instead of all |
--force-triggers | Treat deletion triggers as acceptable |
Without --job, every job in the file is checked.
plan
Displays the relationship tree and processing order.
goarchive plan -c archiver.yaml --job archive_old_orders
| Flag | Description |
|---|---|
-j, --job <name> | The job to display |
Reads the configuration and table structure only.
list-jobs
Lists the jobs a configuration file defines.
goarchive list-jobs -c archiver.yaml
version
Shows version and build information.
goarchive version
Exit status
| Status | Meaning |
|---|---|
0 | Completed successfully |
1 | Did not complete β the message explains why |
