Time a restore and measure it against an RTO and RPO

short · 45 min · Objective 4.4

Task

Set an RTO and RPO for a small file service, back it up on a schedule, "lose" the data, and restore it with a stopwatch running from the moment of loss to the moment the service is verified working. Compare the measured recovery time and the age of the restored data with the targets, and record the gap.

Steps

  1. Record targets in lab/recovery/targets.txt as rto_minutes: 15 and rpo_minutes: 10.
  2. Fill /srv/files with 500 files, schedule the backup, and let it run at least twice. Keep writing a new timestamped file every minute.
  3. Delete the contents of /srv/files and record the time in lab/recovery/log.csv with header time,event as loss.
  4. Restore from the latest backup, restart the share, and verify it from a client. Record restore_started, restore_finished and verified in the log.
  5. Record in lab/recovery/result.txt the lines rto_actual_minutes:, rpo_actual_minutes: (loss time minus the time of the newest restored file) and met: with yes or no for each target.

Verify

These checks run in a POSIX shell: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. A stock Windows PowerShell or Command Prompt has no awk or grep, so there the first line fails.

grep -Ec '^(rto|rpo)_minutes: [0-9]+' lab/recovery/targets.txt
awk -F, 'NR>1 {print $2}' lab/recovery/log.csv | paste -sd' ' -
grep -Ec '^(rto|rpo)_actual_minutes: [0-9.]+' lab/recovery/result.txt
grep -c '^met:' lab/recovery/result.txt

The log records loss, restore start, restore finish and verification in that order, and the result has both actual figures and a verdict. The RPO can never be better than the backup interval: with ten-minute backups, up to ten minutes of new files are lost, which the files written every minute make visible.

Notes

The measured time includes everything: noticing the loss, finding the backup, restoring and verifying. Most real recoveries overrun because of the steps around the restore, not the restore itself, which is why the clock starts at the loss.

This is an independent study companion for CompTIA Server+ SK0-005 and is not produced by or endorsed by CompTIA.