To verify a Restic backup, run restic check and choose a full or partial pack read. Then pick one file from a specific snapshot and restore it to a separate empty directory with --verify.
Use an existing repository you can access and have its password ready. Preparing a new repository
Replace the example repository path /srv/restic-repo, snapshot ID 79766175, sample path /home/user/work/foo, and destination /tmp/restore with your own values.
Check the repository structure
The default check examines the structural consistency of the repository, including snapshots, trees, and pack files. To make check read and verify the backed-up data in the packs, use a data check flag. Working with repositories
In a Linux shell, use echo $? to inspect the exit status. Backing up
Run echo $? immediately after the structure check, your chosen pack check, and the verified restore, before running another command.
restic -r /srv/restic-repo check
Choose how many packs to read
| Check | Command | Coverage |
|---|---|---|
| Full | restic -r /srv/restic-repo check --read-data | Downloads and verifies all pack files in the repository. Working with repositories |
| Subset | restic -r /srv/restic-repo check --read-data-subset=1/5 | Reads and checks the first of five roughly equal groups of pack files. Working with repositories |
Choose one of these commands for the drill. Use the subset if you want to limit how much data the check reads.
Pick a snapshot and sample file
List the repository’s snapshots. The listing includes the snapshot ID, date, host, and backed-up path. Snapshot listing example
restic -r /srv/restic-repo snapshots
Choose the ID for the date, host, and path you want to recover. Use that ID with ls to list the files and directories in the snapshot. restic-ls(1)
restic -r /srv/restic-repo ls 79766175
Absolute and relative backup inputs produce different directory structures in the snapshot. Backing up
The --include option takes a pattern. restic-restore(1)
For this drill, choose a file whose snapshot path has no pattern metacharacters. Copy the file’s exact path from the ls output for --include when passing the snapshot ID on its own. Restoring from backup
Restore the sample to an empty directory
Use an empty directory as the target for the drill. Restic overwrites existing files at the target by default. Restoring from backup
Set --target to that directory and --include to the file’s path in the snapshot. Restoring from backup
The --verify flag checks the contents of the restored files. restic-restore(1)
restic -r /srv/restic-repo restore 79766175 --target /tmp/restore --include '/home/user/work/foo' --verify
Look for the file at /tmp/restore/home/user/work/foo. Restic keeps the path from the snapshot under the target directory in this form of the command. Restoring from backup
Decide whether the drill passed
- Confirm that the structure check, your chosen pack check, and the verified restore each exited with status
0. That status means the command succeeded. restic-check(1) · restic-restore(1)
Mark the drill as passed when the commands succeed and the restored file is at the expected path.
Save the check output for troubleshooting. Troubleshooting
Evidence and limits
This drill follows the Restic 0.20.0 repository and restore documentation and command manuals, checked on 27 November 2026. Working with repositories · restic-restore(1)
No hands-on testing was performed for this guide. The drill covers repository checks and a single-file restore to a separate directory.