美文网首页
强烈推荐这个开源备份工具,程序员人手必备的工具!

强烈推荐这个开源备份工具,程序员人手必备的工具!

作者: 程序员追风 | 来源:发表于2021-12-05 14:03 被阅读0次

前言

备份软件已经是一个老生常谈的话题了,今天要和大家分享一个备份工具——restic。

Restic是一种快速、高效、免费和开源的备份应用程序,它通过AES-256加密保护你的数据,Restic 还利用重复数据删除来帮助节省备份空间。此外,Restic 与大多数主要的云提供商兼容,支持三大操作系统(Linux、macOS、Windows)和一些较小的操作系统(FreeBSD、OpenBSD)。


目前,Restic已经在Github上标星 14.6K,累计分支 999 个

Github地址:https://github.com/restic/restic

首先,你可以从源代码编译restic或从发布页面下载它。一旦安装好restic,就可以开始备份:

$ 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.

并添加一些数据:

$ 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 saved

接下来,你可以restic restore用于恢复文件,要获取所有备份快照的列表,可以使用以下的命令:

restic -r b2:bucketname:/ snapshots

例如:

$ 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

如果你要恢复整个快照,就运行以下命令:

restic -r b2:bucketname:/ restore snapshotID --target restoreDirectory

例如:

$ 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/curt

如果该目录仍然存在于你的系统上,请确保为restoreDirectory指定不同的位置。例如:

restic -r b2:g534fbucket:/ restore d864c465 --target /tmp

要恢复单个文件,请运行如下命令:

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

例如:

$ 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@client

Github地址:https://github.com/restic/restic

相关文章

  • 强烈推荐这个开源备份工具,程序员人手必备的工具!

    前言 备份软件已经是一个老生常谈的话题了,今天要和大家分享一个备份工具——restic。 Restic是一种快速、...

  • Git

    Git原来是有来历的,一群程序员共同维护Linux,需要一项工具,备份,提交,修改。这就催生了Git。 开源网站,...

  • mydumper备份工具介绍与使用

    前言: 前面文章有介绍过 MySQL 系统自带的 mysqldump 备份工具的使用,其实还有一个开源工具 myd...

  • Idea 数据库和redis界面化使用

    Idea 工具是java开发程序员的必备利器,这一个工具几乎可以涵盖所有工具场景。除了idea自带的工具之外,还支...

  • 架构-rsync备份服务实战-02

    1.Rsync 基本概述 rsync是开源的备份工具,可在不同主机之间进行同步.可实现增量备份合全量备份,适合本地...

  • MongoDB 备份与恢复

    mongodb 备份与恢复 一.工具介绍 二.备份工具区别 三.mongoexport/mongoimport工具...

  • 11.MySQL备份详解

    0.备份介绍1.备份类型2.冷、温、热备份3.备份工具介绍4.备份工具详解一:mysqldump5.备份工具详解二...

  • mongodb备份

    1. 备份恢复 1.1 备份恢复工具介绍: 1.2 备份工具区别在哪里? 1.3 导出工具mongoexport ...

  • 官网地址

    rsync:是开源的、高速的、可实现本地和远程、全量、增量 备份工具 https://www.samba....

  • 程序员必备的6大强大的工具

    程序员必备的6大强大的工具 姓名:程英鑫 学号:16020140082 学院...

网友评论

      本文标题:强烈推荐这个开源备份工具,程序员人手必备的工具!

      本文链接:https://www.haomeiwen.com/subject/eqzpxrtx.html