安装 #
sudo pacman -S restic rclonerestic #
创建存储库 #
本地:
restic init -r /srv/restic-reporclone:
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 bdbd3439restic -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-reporclone #
配置 #
rclone configgoogle 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:pathrclone 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服务