Build an automated nightly restore verification
Task
The strongest backup control available is a restore that happens every night without a human. Build one: restore into isolation, assert on the result, and report a pass or fail with a measured duration.
Steps
- Run a database with a known dataset and an automated backup writing to a separate location. Record a row count and a checksum over a key table as the expected values.
- Write
lab/restore-check.shthat: provisions a fresh isolated target, restores the latest backup into it, runs the assertions, records the duration of each phase, and exits non-zero on any failure. - Run it and capture a passing result in
lab/restore-pass.txt, including the phase timings. - Prove it detects: corrupt or truncate the latest backup, run the script again, and capture the FAILING result in
lab/restore-fail.txt. - Compare the total measured restore duration against an RTO you state in
lab/restore-check.md, and write what you would change if it did not meet it.
Verify
test -x lab/restore-check.sh && echo "script present"
grep -Eci 'pass|ok' lab/restore-pass.txt
grep -Eci 'fail|mismatch|error' lab/restore-fail.txt
grep -Ec '[0-9]+ ?(s|sec|second|min)' lab/restore-pass.txt
grep -Eci 'rto' lab/restore-check.md
Both outcomes captured and a measured duration present. A verification script that has only ever passed is the same unproven claim as the backup it checks.
Notes
The restore target is isolated with no route to anything that matters, which is what stops a restored copy sending real messages or writing to real integrations.
This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.