| title | pg hardstorage backup undelete | ||
|---|---|---|---|
| description | CLI reference for the pg hardstorage backup undelete command. | ||
| tags |
|
Resurrect one or more soft-deleted backups (removes tombstone marker)
undelete removes the tombstone marker for the named backup(s),
making them visible again to backup list and restore.
Use this to recover from an over-aggressive delete or cascade
before chunk-GC runs. The window is bounded: once
repo gc --apply has reclaimed the chunks the manifest
references, undelete will succeed but the resulting backup will
fail to restore. Run backup undelete BEFORE the next
GC cycle.
Idempotent. An undelete of a manifest that's already live is a no-op; no error, no audit entry. Multiple IDs may be passed — the operation walks them in argv order and reports each one's outcome.
Pairs with backup delete --cascade: the cascade response's
cascade_deleted slice (or the equivalent audit body
field) is exactly what you pass back to undelete to
unwind a wrong cascade.
Restorability pre-flight (--check-chunks): --check-chunks Stat every chunk referenced by each manifest BEFORE removing its tombstone. Refuses with conflict.chunks_missing if any required chunk is absent — telling you the manifest can't be meaningfully restored even if you resurrect it. Same primitive that backs verify --existence-only. --skip-missing When --check-chunks fires on multi-ID input, skip the manifests with missing chunks and undelete the rest. Without --skip-missing, the whole operation refuses up-front (atomic semantics — same posture as cascade delete).
pg_hardstorage backup undelete <deployment> <backup-id> [<backup-id>...] [flags]
--check-chunks verify --existence-only refuse to undelete a manifest whose chunks have been GC'd (Stat-only pre-flight; same primitive as verify --existence-only)
--force resurrect even when chunks are gone — recover the metadata of an un-restorable backup (skips the restorability pre-flight; forensic use)
-h, --help help for undelete
--reason string free-form reason captured in the audit chain (recommended for forensics)
--repo string repository URL (required)
--skip-missing when --check-chunks fails on some IDs, undelete the rest (default: refuse the whole batch)
--airgapped airgapped: strict refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
-c, --config string path to config file (default: XDG/FHS lookup)
--cpu-profile go tool pprof <path> write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
--mem-profile string write a pprof heap profile to this path at command exit. Off when empty.
--no-color disable ANSI color in text output
--on-error-llm on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
--otel-endpoint string OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
--otel-stdout also export OpenTelemetry traces to stderr (useful for dev)
-o, --output string output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
--profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30 if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
-q, --quiet suppress non-essential output
--template string Go text/template applied when --output template (or implied if --template is set without --output)
- pg_hardstorage backup - Take a backup of a deployment