当前位置: 首页 > news >正文

restic on Windows

1.安装restic(使用winget)

打开Powershell或CMD,输入以下命令:

winget search restic
名称               ID                             版本   匹配        源
---------------------------------------------------------------------------
restic             restic.restic                  0.18.1             winget
resticprofile      creativeprojects.resticprofile 0.32.0 Tag: restic winget
restic-browser     emuell.restic-browser          v0.3.3 Tag: restic winget
Backrest           garethgeorge.Backrest          1.10.1 Tag: restic winget
Restic REST Server restic.server                  0.14.0             winget
PS C:\Users\X> winget install --exact --id restic.restic --scope Machine
已找到 restic [restic.restic] 版本 0.18.1
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
正在下载 https://github.com/restic/restic/releases/download/v0.18.1/restic_0.18.1_windows_amd64.zip██████████████████████████████  10.7 MB / 10.7 MB
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
添加了命令行别名: "restic"
已修改路径环境变量;重启 shell 以使用新值。
已成功安装

 

以上,其中,添加了一个 --scoop machine 参数,这个参数表示为所有用户安装,如果没有添加这个参数,那么就默认为当前用户安装。

2. Initialize the repository (first time only):

restic init --repo D:\Backup\restic-repo

 根据提示输入密码即可。

3.备份:

restic -r D:/Backup/restic-repo --verbose=2 backup D:/Documents

 以上命令即备份 D:/Documents

4.查看备份:

restic -r D:/Backup/restic-repo snapshots
enter password for repository:
repository 3604a61c opened (version 2, compression level auto)
ID        Time                 Host        Tags        Paths         Size
-------------------------------------------------------------------------------
94975e75  2025-10-30 08:25:45  SPACE                   D:\Documents  41.321 KiB
3114ce27  2025-10-30 08:44:09  SPACE                   D:\Documents  41.321 KiB
-------------------------------------------------------------------------------
2 snapshots

 5.删除快照:

restic -r D:/Backup/restic-repo forget 94975e75
enter password for repository:
repository 3604a61c opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 files deletedrestic -r D:/Backup/restic-repo snapshots
enter password for repository:
repository 3604a61c opened (version 2, compression level auto)
ID        Time                 Host        Tags        Paths         Size
-------------------------------------------------------------------------------
3114ce27  2025-10-30 08:44:09  SPACE                   D:\Documents  41.321 KiB
-------------------------------------------------------------------------------
1 snapshotsrestic -r D:/Backup/restic-repo prune
enter password for repository:
repository 3604a61c opened (version 2, compression level auto)
loading indexes...
[0:00] 100.00%  1 / 1 index files loaded
loading all snapshots...
finding data that is still in use for 1 snapshots
[0:00] 100.00%  1 / 1 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:00] 100.00%  2 / 2 packs processedto repack:             0 blobs / 0 B
this removes:          0 blobs / 0 B
to delete:             0 blobs / 0 B
total prune:           0 blobs / 0 B
remaining:            39 blobs / 50.267 KiB
unused size after prune: 0 B (0.00% of remaining size)done

 6.验证所有数据都正确地存储在存储库中:

restic check -r D:/Backup/restic-repo
using temporary cache in C:\Users\X\AppData\Local\Temp\restic-check-cache-3358689233
create exclusive lock for repository
enter password for repository:
repository c42e0a65 opened (version 2, compression level auto)
created new cache in C:\Users\X\AppData\Local\Temp\restic-check-cache-3358689233
load indexes
[0:00] 100.00%  3 / 3 index files loaded
check all packs
check snapshots, trees and blobs
[0:00] 100.00%  3 / 3 snapshots
no errors were found

7.恢复快照:

restic -r D:/Backup/restic-repo restore 3114ce27 --target D:/f
enter password for repository:
repository 3604a61c opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
restoring snapshot 3114ce27 of [D:\Documents] at 2025-10-30 08:44:09.2127904 +0800 CST by SPACE\X@SPACE to D:/f
Summary: Restored 45 files/dirs (41.321 KiB) in 0:00

 That's All.

 

http://www.jsqmd.com/news/337920/

相关文章:

  • 亚马逊云渠道商:AWS RDS备份恢复实战
  • 2026年选GEO服务商别盲目!豆包GEO全栈技术,实现AI引用转化翻倍 - 品牌2025
  • 投稿核心期刊总碰壁?虎贲等考 AI:用 “学术 GPS 导航” 解锁见刊新路径
  • G-MemLLM Gated Latent Memory Augmentation for Long-Context Reasoning in Large Language Models
  • 长尾关键词策略与SEO配合,提升网站曝光的高效方案
  • 一篇搞定全流程,AI论文平台 千笔·专业学术智能体 VS 笔捷Ai,本科生专属首选!
  • 2026 年口碑好的外墙装饰挂板厂家最新权威实力榜 - 朴素的承诺
  • 数据分析不用 “拜统计大神”!虎贲等考 AI:让科研小白也能出 “期刊级” 实证结果
  • Thinkphp和Laravel框架的高校学生社团经费会费管理系统的设计与实现 可视化
  • Thinkphp和Laravel框架的高校应届毕业生就业招聘信息管理系统的设计与实现
  • 泰康大内容云平台:企业内容运营的标杆实践与数字化转型启示
  • 开题报告被批 “空想家”?虎贲等考 AI 让研究 “落地可行”,评审秒点头!
  • Flutter 与开源鸿蒙混合工程开发实战指南 - 教程
  • Thinkphp和Laravel框架的高校教师科研项目管理系统的设计与实现
  • 亚马逊云渠道商:AWS RDS数据库如何应用?
  • 苹果 iPhone 13 高质量全方位解析|配色外观|核心参数|影像与续航|官方维修手册要点|二手验机避坑清单
  • Thinkphp和Laravel框架的高校两校区通勤校车预约系统的设计与实现 论文
  • JAVA代码覆盖率工具JaCoCo-原理篇
  • 平顶山英语雅思培训机构推荐。2026权威测评出国雅思辅导机构口碑榜 - 苏木2025
  • 瀚高数据库不同版本对实例级用户的支持情况
  • Thinkphp和Laravel框架的高校大学生就业信息求职招聘需求的数据分析系统的设计与实现
  • 天翼云全栈赋能OpenClaw,打造会干活的专属AI!
  • 2026年 浙江康复/照护机构推荐榜:专业诊疗与暖心服务口碑之选 - 品牌企业推荐师(官方)
  • 2026年8款靠谱免费AI论文工具实测:查重率低于12%、原创度高,告别熬夜赶稿! - 麟书学长
  • 别再瞎找了!9个AI论文平台深度测评,专科生毕业论文写作必备神器
  • Thinkphp和Laravel框架的高校学生宿舍管理系统的设计与实现 功能多
  • 国产高性能卡钳品牌全国推荐指南 - 改装小龙
  • git查看commit的变动的文件
  • Thinkphp和Laravel框架的钢构企业的生产过程控制管理系统设计与实现_ngja5ia7
  • 凯里市英语雅思培训机构推荐,2026权威测评出国雅思辅导机构口碑榜单 - 老周说教育