Extra tools to manage Restic repositories, mostly intended for restic developers and advanced users.
GO111MODULE=on go get github.com/rubiojr/rapi/cmd/rapi
Or clone the repository and type:
git clone https://github.com/rubiojr/rapi
cd rapi
make
No binaries available for the moment.
rapi repository info
Prints basic repository information.
rapi repository id
Prints restic's repository ID.
rapi snapshot info
Prints basic snapshot information retrieved from the latest available snapshot.
- Total Blob Count: the number of tree and data blobs in the snapshot.
- Unique Files Size: the deduplicated size (in bytes) of the files in the snapshot (the sum of the size of all the blobs).
- Total Files: the total number of files, excluding directories and other special files.
- Unique Files: the total number of files, excluding duplicates.
- Restore Size: the snapshot size after restoring it.
rapi rescue restore-all-versions
Given a pattern, restore all matching files to the target directory.
To restore all files matching *hello
to /tmp
:
This will walk all the snapshots available in the repository and restore all the files matching the given pattern (glob pattern, not regular expression) to the target directory. The file ID (short SHA256 sum of the file blobs hashes) is prepended to the file name, so if there are multiple versions of the same file, all the versions will be safely restored.
If the file name is larger than 254 characters, it'll be truncated.
Use cases:
Restic's cat command that does not lock the repository. See restic/restic#2739.
rapi cat masterkey
Prints master key to stdout.
rapi cat blob <blob ID>
Dumps trees and data blobs to stdout.
rapi cat index <index ID>
Dumps indices to stdout.
rapi cat snapshot <snapshot ID>
Dumps snapshots to stdout.
rapi cat config
Dumps repository configuration to stdout.
rapi index-mem-stats
The memory consumed by Restic when loading the repository index.