restic is backup software used from the command line. It saves files and directories into a repository, and it records the contents at one moment in a snapshot. After a backup finishes, judging whether the expected contents were saved means looking together at the command’s exit status, the snapshot’s source paths, and the files inside the snapshot. [1][2]
To use it, install restic for the operating system, prepare a repository, and then run backup. After that, use snapshots to find a snapshot, and if needed name a snapshot ID to restore. The project offers binaries that can be run directly, and it also lists how to install on each system. [1][3]
For example, the lines below use a local repository and a working directory to show the basic paths. At initialization, set the repository password when prompted. Later commands enter the same password when prompted:
restic -r /srv/restic-repo init
restic -r /srv/restic-repo backup ~/work
restic -r /srv/restic-repo snapshots
init creates the repository the first time. -r names the repository location. The ID, time, host, and directories in the snapshot list help find the backup to inspect. [1][4]
When a source path is missing or cannot be reached
restic 0.19.0 corrected the exit status for a missing path: if any path among the backup sources does not exist, backup returns exit code 3. Before that, a missing top-level source path could still return 0, so a script that depended on the exit code could mistake the backup for complete. [5]
0.19.1 then handled another kind of case. Apart from whether a source path exists, it may be unreachable for another reason, such as a badly formed path on Windows. Before, such a path could be kept and produce an empty snapshot. In 0.19.1, restic skips an unreachable source path, and if no usable path remains it aborts the backup. That sentence describes 0.19.1, not every later release. [6]
When checking, do not look only at whether there is a new snapshot. The official documentation uses backup’s exit code 3 for the case where some source data cannot be read and the rest forms an incomplete snapshot. Exit code 1 means a fatal error, and no snapshot was created. In a shell such as on Linux, echo $? can be run immediately after backup to see the exit code, and the command output can then be used to locate the path that failed. An automated task should also treat a non-zero exit status as a result that needs handling. [2]
“Latest” can be one from each group
When looking at the most recent backup, the result of restic -r /srv/restic-repo snapshots --latest 1 has to be read by groups. 0.19.0 unexpectedly changed the behavior when --group-by was not given. 0.19.1 restored the default of grouping by host and path, then choosing the latest snapshot from each group. Different hosts or source paths that share a repository may therefore each show one line. The whole list cannot be taken as the single latest backup in the repository. When --group-by is given explicitly, the grouping follows what was specified. [6]
To inspect one task, first match the time, host, and directory in the snapshots list, and note the target snapshot ID. --host or --path can also narrow the list. That separates backups from different sources. The exit status and the output then say whether an omission needs handling, rather than treating one line in the list as proof that every source path was saved. [4]
When browsing a mount, watch where the repository sits
restic can also mount the repository contents for browsing. For a local repository, 0.19.1 resolves the repository path and the mount-point path and refuses an overlap: the mount point cannot be the repository directory itself, cannot contain the repository directory, and cannot lie inside the repository directory. Before, that overlap could let the FUSE service read its own backend files through the mount point and cause a kernel deadlock. [6]
If a mount keeps running and a new snapshot is created during that time, 0.19.1 also fixes a problem in which, after snapshots were reloaded, the latest symbolic link could still point at the old snapshot. While browsing, the snapshot ID, the time, and the source path can still be used together to confirm what is being viewed. [6]
When contents need to be taken back, use an ID chosen from the list, for example restic -r /srv/restic-repo restore SNAPSHOT_ID --target /tmp/restore. The restore target is a directory named separately. A definite ID ties the snapshot to be restored to the record just inspected. [7]
What 0.20.0 changes in restore
restic 0.20.0 was published on 19 November 2026. The notes here are from the official release notes, read on 21 November 2026. This article did not install or test 0.20.0. The 0.19.0 and 0.19.1 account above remains the history of those versions. It is not a description of every command in the current release.
The restic 0.20.0 release notes[8] document four restore changes that matter for the restore command in this article:
- With
restore --ownership-by-name, a user or group name that could not be resolved on the restore host, or that was not recorded in the snapshot, used to set the restored file’s owner to UID/GID 0. Together with restored setuid or setgid bits, that could produce an unintended setuid-root file. 0.20.0 instead falls back to the numeric UID and GID stored in the snapshot and prints a warning. - A snapshot tree that contained a symlink and a directory with the same name could let
restorewrite through the symlink to files outside the restore target. 0.20.0 rejects a tree whose node names are not strictly increasing, and it reports an error instead of restoring that snapshot. - Restoring over an existing hard-linked file that only partly matched the file in the snapshot used to leave zero bytes in the unchanged parts. 0.20.0 rewrites the whole file in that case.
- If
restore --deletecould not load a directory’s tree, for example because a pack file was missing, restic reported an error and then deleted the existing contents of that directory in the target. 0.20.0 turns deletion off for the rest of that restore when a tree cannot be loaded.
The same notes also say that, since 0.19.0, a snapshot with an empty directory written by an older repair snapshots could fail while its tree was decoded, and that 0.20.0 lets prune, check, and restore process those snapshots. That is a later fix for an interaction with 0.19.0. It does not rewrite the exit-code rules of 0.19.0 and 0.19.1 above.
References
-
restic 0.20.0 release notes, published 19 November 2026, read 21 November 2026. Not installed or tested for this article.