Skip to content

CICD-350 · Disaster recovery validation ​

Encyclopedia · Distributed systems and reliability testing · All snippets

Previous · CICD-349 · Next · CICD-351

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites disposable integration environment, synthetic traffic and controlled test faults.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters RESTORE_URL.

2. Copy the snippet ​

bash
start=$(date +%s)
pg_restore --exit-on-error --no-owner --dbname="${RESTORE_URL:?}" backup.dump
psql "$RESTORE_URL" -v ON_ERROR_STOP=1 -f tests/disaster-recovery.sql
echo "restore_seconds=$(( $(date +%s) - start ))"

3. How it works ​

The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream. Restore reads the custom-format archive and applies it to the specified disposable target. Keep schema and application checks after load.

4. Verify the result ​

Verify a disposable restore using an expected recovery point and elapsed time. Compare both RPO and RTO against the runbook.

Validation syntax-validated (Bash parse). Status definitions.