安装 #
sudo pacman -S restic rclone
restic #
创建存储库 #
本地:
restic init -r /srv/restic-repo
rclone:
restic -r rclone:foo:bar init
备份 #
restic -r /srv/restic-repo --verbose backup ~/work [--tag foo --tag see]
使用存储库 #
列出所有快照 #
restic -r /srv/restic-repo snapshots
检查完整性和一致性 #
restic -r /srv/restic-repo check --read-data
恢复备份 #
restic -r /srv/restic-repo restore latest --target /tmp/restore-work
或
restic -r /srv/restic-repo mount /mnt/restic
删除备份快照 #
restic -r /srv/restic-repo forget bdbd3439
restic -r /srv/restic-repo prune
或
restic -r /srv/restic-repo forget --keep-last 1 --prune
加密 #
管理存储库密钥 #
restic key [list|add|remove|passwd] [ID] -r /srv/restic-repo
rclone #
配置 #
rclone config
google drive #
https://rclone.org/drive/#making-your-own-client-id
同步 #
rclone sync SOURCE remote:DESTINATION [-i --dry-run]
使源和目标相同,仅修改目标
列出 #
rclone [ls|lsd|lsl]
删除 #
rclone purge remote:path [-i --dry-run]
创建路径 #
rclone mkdir remote:path
rclone server(WebDAV) #
rclone 可以作为服务端提供存储,提供webdav服务:
rclone serve webdav /path/to/local/storage --addr 127.0.0.1:8080 --baseurl "/rclone" --user user-name --pass secret
- addr: 监听地址
- baseurl: 服务的提供路径
- user: 用户名,用于认证
- pass: 密码,用于认证
可以使用systemd起一个守护进程:
[Unit]
Description=rclone
[Service]
ExecStart=rclone serve webdav /path/to/local/storage --addr 127.0.0.1:8080 --baseurl "/rclone" --user user-name --pass secret
[Install]
WantedBy=multi-user.target
另外可以使用caddy反向代理rclone服务