Backup operations: create, list, restore, verify, prune, config, status, init-key.
nself backup <subcommand> [flags] [args]
nself backup covers the full life cycle of project backups: full Postgres dumps, write-ahead-log (WAL) checkpoints, MinIO object snapshots, configuration metadata, and combined backups. Backups can be encrypted with age (one keypair per project) and pruned by retention policy.
Subcommands include create (one-shot full or incremental), list (filter by remote, environment, age), restore (from any backup ID or latest, with point-in-time recovery and partial restore options), verify (checksum or full restore-test in a disposable container), and prune (apply daily/weekly/monthly retention).
backup config --install-cron installs systemd timers for full backups, WAL checkpoints, prune cycles, and weekly verify drills so an operator can hand off to automation.
Name Description createCreate a new backup listList available backups restore <backup-id|latest>Restore from a backup verify <backup-id|latest>Verify backup integrity pruneRemove old backups by retention policy configView or install backup configuration (systemd timers) statusShow backup subsystem status init-keyGenerate age encryption keypair for backups
Flag Default Description --typefullBackup type: full, wal, metadata, minio, all --remote""Remote name override --encryptfalse Force encryption on --no-encryptfalse Force encryption off --tag""Human label for this backup --dry-runfalse Preview only
Flag Default Description --remote""Filter by remote name --env""Filter by environment --since""Show backups newer than duration (e.g. 24h, 7d) --formattableOutput format: table or json
Flag Default Description --to""Restore to alternate directory --only""Restore subset: pg, minio, metadata (comma-separated) --point-in-time""ISO8601 timestamp for PITR --decrypt-key""Path to age identity file --yesfalse Skip confirmation
Flag Default Description --restore-testfalse Spin up test container and restore --cleanuptrue Remove test container after verify --keepfalse Keep test container for inspection
Flag Default Description --dry-runfalse Preview only --keep-daily7Keep last N daily backups --keep-weekly4Keep last N weekly backups --keep-monthly12Keep last N monthly backups --format""Output format: json
Flag Default Description --format""Output format: json --install-cronfalse Install systemd timers for backup, WAL, prune, verify --full-at03:00Full backup time UTC (HH:MM) when --install-cron --wal-every15mWAL checkpoint interval when --install-cron --prune-at04:00Prune time UTC (HH:MM) when --install-cron --verify-onSunWeekly restore-test day when --install-cron --verify-at05:00Weekly restore-test time UTC when --install-cron --remote""Override configured remote when --install-cron --unit-dir/etc/systemd/systemSystemd unit directory when --install-cron --dry-runfalse Print unit files without writing when --install-cron
Flag Default Description --format""Output format: json
# Generate the age keypair before first encrypted backup
# Create a full encrypted backup tagged for traceability
nself backup create --type full --encrypt --tag pre-deploy
# List backups newer than a week, JSON for piping
nself backup list --since 7d --format json
# Restore latest backup, restoring only Postgres data
nself backup restore latest --only pg --yes
# Verify the latest backup with a real restore-test container
nself backup verify latest --restore-test
# Install systemd timers so backups run automatically
sudo nself backup config --install-cron --full-at 02:30
← Commands | Home →