1、软件环境准备及下载
1.1、下载restic
下载地址:https://github.com/restic/restic/releases
注意:windows7下载版本0.16.2(包含)及以下版本,否则新版本因为go的win7限制无法正常运行
运行命令环境自行配置
1.2、下载rest-server
1)、rest-server下载地址:https://github.com/restic/rest-server/releases
2)、Apache运行htpasswd命令下载地址:https://httpd.apache.org/docs/current/platform/windows.html#down
下载红色框中软件

对上述两个软件配置环境变量,方便后续操作
2、启动服务端rest-server
2.1、在备份目录下配置加密文件,或者使用–htpasswd-file指定
htpasswd -B -c .htpasswd username
2.2、启动服务
rest-server.exe --path E:\code --listen 0.0.0.0:9999 --htpasswd-file E:\code\\.htpasswd
- 注意:防火墙记得开端口
3、客户端访问
3.1、初始化仓库
restic init -r rest:http://username:password@192.168.1.19:9999/test
然后输入密码
3.2、备份文件到仓库 test 文件夹下
restic -r rest:http://username:password@192.168.1.19:9999/test --verbose backup J:\app-debug.apk
3.3、查看备份文件
restic -r rest:http://username:password@192.168.1.19:9999/test snapshots
3.4、还原备份仓库
restic -r rest:http://username:password@192.168.1.19:9999/test restore 8f7d0f8c --target J:\data\
8f7d0f8c 为使用 snapshots 查看文件的对应ID

1255

被折叠的 条评论
为什么被折叠?



