Restic is a modern backup program that can back up your files encrypted and safely:
from Linux, BSD, Mac and Windows
to many different storage types, including self-hosted and online services
easily, being a single executable that you can run without a server or complex setup
effectively, only transferring the parts that actually changed in the files you back up
securely, by careful use of cryptography in every part of the process
verifiably, enabling you to make sure that your files can be restored when needed
freely - restic is entirely free to use and completely open source
If you are using macOS, you can install restic using the homebrew package manager:
You can learn how to install Restic from Installation — restic 0.12.0 documentation - https://restic.readthedocs.io/en/stable/020_installation.html.
First initialize the repository.
restic -r <Your repository> init
Backup your local folder to the repository.
restic backup <Your Local Folder>
Show snapshot list.
Show content within the special snapshot.
restic ls <Your Snapshot ID>
Mount the repository into you local mounting folder.
restic mount <Your Local Mounting Folder>
Mounting repositories via FUSE is only possible on Linux, macOS and FreeBSD. On Linux, the fuse kernel module needs to be loaded and the fusermount command needs to be in the PATH. On macOS, you need FUSE for macOS Home - macFUSE - https://osxfuse.github.io/. On FreeBSD, you may need to install FUSE and load the kernel module (kldload fuse).
Restoring from backup
Restoring from a snapshot
Restoring a snapshot is as easy as it sounds, just use the following command to restore the contents of the latest snapshot to
restic restore <Your Snapshot ID> --target <Your Local Restoring Folder>
Restore using mount
See above Mount
Removing backup snapshots
In order to remove the snapshot of repository, use the
forget command and specify the snapshot ID on the command line:
restic forget <Your Snapshot ID>
But the data that was referenced by files in this snapshot is still stored in the repository. To cleanup unreferenced data, the
prune command must be run:
You can automate this two-step process by using the
--prune switch to forget:
restic forget --keep-last 1 --prune
The key command allows you to set multiple access keys or passwords per repository. In fact, you can use the list, add, remove, and passwd (changes a password) sub-commands to manage these keys very precisely:
restic key list