This article is a mirror article of machine translation, please click here to jump to the original article.

View: 1229|Reply: 2

Use the open-source tool Restic Incrementally back up disk files

[Copy link]
Posted on 2025-4-4 14:46:16 | | | |
Restic introduced

Restic is a modern backup program that backs up your files:

  • From Linux, BSD, Mac, and Windows
  • Many different storage types, including self-hosted and online services
  • It's easy, and as an executable, you can run it without a server or complex setup
  • Effectively, only the parts of the backup file that have actually changed are transferred
  • Ensure security by using encryption carefully in every part of the process
  • Verifiable, enabling you to ensure that your files can be recovered when needed
  • Free restic is completely free to use and completely open source


Compatibility:Once version 1.0.0 is released, we guarantee that all repositories are backwards compatible within one major release; As long as we do not add the major version, the data can be read and recovered. We strive to be fully backwards compatible with all previous versions.

Repository support:

  • Local
  • SFTP
  • REST Server
  • Amazon S3
  • Minio Server
  • S3-compatible Storage
  • Wasabi
  • Alibaba Cloud (Aliyun) Object Storage System (OSS)
  • OpenStack Swift
  • Backblaze B2
  • Microsoft Azure Blob Storage
  • Google Cloud Storage
  • Other Services via rclone
  • Password prompt on Windows
  • Group accessible repositories
  • Repositories with empty password


Official Website:The hyperlink login is visible.
Windows Download:The hyperlink login is visible.
Documentation:The hyperlink login is visible.
Command Line Parameters:The hyperlink login is visible.
Source:The hyperlink login is visible.
Design idea:The hyperlink login is visible.

Windows download and install

Download the Windows version of the tool to unzip the package. Rename restic_0.18.0_windows_amd64.exe to restic.exe and put it in%SystemRoot%\System32Table of contents below. Omit (or add to environment variables)

Restic tutorial

Initialize the repository

Take the local repository demo as an example:




Backup files

Back up the disk files to the repository (back up all files in the D:\360Downloads directory) with the following command:




Trial run

You can perform a backup in trial run mode, that is, you can view the specific modification information without committing with the following command:




List all snapshots

Restic's snapshot doesContains the state of all files, not just those modified, added, or deleted。 However, due to its efficient deduplication mechanism, the actual amount of data stored is optimized, avoiding repeatedly storing the same content. This design makes Restic highly efficient at backing up large amounts of similar data while preserving the independence and integrity of each snapshot.

The command is as follows:




Lists the files in the snapshot

To get a list of files in a specific snapshot, you can use the following ls command:




Check for completeness and consistency

This command should be run periodically to ensure that the repository's internals are error-free, as follows:




Delete backup snapshots

Delete backup snapshots, keep only the last (that is, the latest) snapshot, and when forget runs with a policy, restic first loads a list of all snapshots, then presses itHostnames and paths group them(That is, different hostnames and paths will keep a snapshot, not just one in the end!) )。 The command is as follows:




Restore from backup

To recover files from snapshots, the command is as follows:




Manage the keys to the warehouse

key command allows us to set multiple access keys or passwords for each repository. In fact, we can also manage these keys precisely using the list, add, remove, and passwd subcommands.




frequently asked questions

Problems with cold storage warehouses

Not supported. Experimental support for restoring from the S3 Glacier and S3 Glacier Deep Archive storage classes is currently available.

Back up to AWS S3 Glacier

The hyperlink login is visible.
The hyperlink login is visible.

Restic Judgment Source

If multiple identical directory file contents need to be backed up to our server, using restic backup on server A will carry some information from server A (as shown below). After that, if you need to synchronize the incremental data on server B, you can't synchronize incrementally. Because restic will determine whether it is from the same source based on the following representation.

ID: 快照的版本号
Time: 备份的时间
Host: 备份服务器的主机名
Tags: 备份指定的标签
Paths: 备份的服务器路径

Reference:The hyperlink login is visible.




Previous:.NET/C# parent-child processes communicate using MemoryMappedFile
Next:AWS S3 Object Storage Creation Bucket and IAM Policy Setup tutorial
 Landlord| Posted on 2025-4-4 14:51:19 |
Add tags when backing up

 Landlord| Posted on 2025-4-5 10:12:01 |
Restic is based on a Linux system that uploads files to S3 buckets

Rocky Linux installs Restic


Initialize the S3 bucket


Back up files to S3 buckets

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com