restic version
的输出restic 0.9.6 在 linux/amd64 上用 go1.13.4 编译
restic -r 备份/快照
我将备份存储在本地机器的备份目录中
Expected behavior
-----------------
restic -r backups/ snapshots
repository a59cec13 opened successfully, password is correct
ID Time Host Tags Paths
-----------------------------------------------------------------------------------------------------
94b78cGh 2020-03-05 13:24:10 osw /var/www/standard
-----------------------------------------------------------------------------------------------------
1 snapshots
我希望 restic 正确读取 RESTIC_PASSWORD
我已经在 .bashrc 文件中设置了RESTIC_PASSWORD
,以便让 cron 自动进行备份,但如果我不这样做,总是要求输入密码RESTIC_PASSWORD=$RESTIC_PASSWORD
Restic 要求输入密码
在 .bashrc 中设置静态密码,然后运行source ~/.basrc
并运行restic -r /foo snapshots
不
我已经解决了这个解决方法export RESTIC_PASSWORD=$RESTIC && restic -r ....
我刚刚尝试过,它对我有用。 也许您的 .bashrc 中有错字?
@RafaelAybar您还需要在 bashrc 中添加export RESTIC_PASSWORD
。 否则 bash 不会将环境变量传递给 restic。
我刚刚尝试过,它对我有用。 也许您的 .bashrc 中有错字?
否,但我需要在退出并重新登录时导出RESTIC_PASSWORD=$RESTIC_PASSWORD
最有用的评论
@RafaelAybar您还需要在 bashrc 中添加
export RESTIC_PASSWORD
。 否则 bash 不会将环境变量传递给 restic。