您现在的位置是:亿华云 > 应用开发
GitHub标星14K!程序员人手必备的开源备份工具
亿华云2025-10-03 06:40:40【应用开发】3人已围观
简介备份软件已经是一个老生常谈的话题了,今天,猿妹要和大家分享一个备份工具——restic。Restic是一种快速、高效、免费和开源的备份应用程序,它通过AES-256加密保护你的数据,Restic 还利
备份软件已经是标星必备一个老生常谈的话题了,今天,人手猿妹要和大家分享一个备份工具——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> to /tmp很赞哦!(51)
上一篇: 数据中心高温管理指南
下一篇: 备份服务器免受勒索软件攻击的 9 个步骤