Backup software has been a platitude topic, today, I want to share a backup tool — Restic.

Restic is a fast, efficient, free and open source backup application that protects your data with AES-256 encryption. Restic also takes advantage of deduplication to help save backup space. In addition, Restic is compatible with most major cloud providers and supports three major operating systems (Linux, macOS, Windows) and some smaller operating systems (FreeBSD, OpenBSD).

Restic currently has a 14.6K star on Github and 999 branches

Github address: github.com/restic/rest…

First, you can compile Restic from source or download it from the release page. Once Restic is installed, you can start backing up:

$ restic init --repo /tmp/backup
enter password for new backend:
enter password again:
created restic backend 085b3c76b9 at /tmp/backup
Please note that knowledge of your password is required to access the repository.
Losing your password means that your data is irrecoverably lost.
Copy the code

And add some data:

$ restic --repo /tmp/backup backup ~/work enter password for repository: scan [/home/user/work] scanned 764 directories, 1816 Files in 0:00 [0:29] 100.00% 54.732 MiB/s 1.582 GiB / 1.582 GiB 2580/2580 items 0 errors ETA 0:00 duration: 0:29, 54.47MiB/ S Snapshot 40DC1520 SavedCopy the code

Next, you can use restic restore to restore files. To get a list of all backup snapshots, use the following command:

restic -r b2:bucketname:/ snapshots
Copy the code

Such as:

$ restic -r b2:g534fbucket:/ snapshots
enter password for repository: 
ID Date Host Tags Directory
----------------------------------------------------------------------
d864c465 2018-03-27 15:20:42 client /home/curt/Documents
Copy the code

If you want to restore the entire snapshot, run the following command:

restic -r b2:bucketname:/ restore snapshotID --target restoreDirectory
Copy the code

Such as:

$ restic -r b2:g534fbucket:/ restore d864c465 --target ~ enter password for repository: Restoring <Snapshot D864C465 of [/home/curt/Documents] at 2018-03-27 15:20:42.833131988-0400 EDT by curt@client> to /home/curtCopy the code

If the directory still exists on your system, be sure to specify a different location for restoreDirectory. Such as:

restic -r b2:g534fbucket:/ restore d864c465 --target /tmp
Copy the code

To restore a single file, run the following command:

$ restic -r b2:g534fbucket:/restore snapshotID --target restoreDirectory --include filename
Copy the code

Such as:

$ restic -r b2:g534fbucket:/ restore d864c465 --target /tmp --include file1.txt enter password for repository: Restoring <Snapshot D864C465 of [/home/curt/Documents] at 2018-03-27 15:20:42.833131988-0400 EDT by curt@clientCopy the code

Github address: github.com/restic/rest…