跨平台、多端加密同步神器 Restic

链接:https://www.hi-linux.com/posts/42308.html

一、基本使用

1.1 安装

sudo apt-get install restic

1.2查看版本

restic version

1.3自升级

restic self-update

1.4创建仓库

restic init --repo /home/restic/seafile_backups

1.5手工备份

restic -r /home/restic/seafile_backups --verbose backup /home/seafile/files

1.6免输密码备份

# 创建密码文件
echo "000" >/home/restic/password.txt
# 备份命令
restic -r /home/restic/seafile_backups --verbose backup /home/seafile/files --password-file=/home/restic/password.txt

1.7定时自动备份

# 仅添加当前登录用户定时任务
crontab -e -u restic
# 每天凌晨5:00自动备份
0 5 * * *       restic -r /home/restic/seafile_backups --verbose backup /home/seafile/files --password-file=/home/restic/password.txt