I’m trying to use the password-file option to read my b2 credentials, but I’m running into a little trouble.
When I run restic with --password-file /home/me/passwd.txt
it returns the message:
"Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty.
If I don’t specify the repo with the -r flag, but instead try to read that from the passwd.txt file, it gives me the message:
“Fatal: Please specify repository location”
So, it appears that restic is not accessing the passwd.txt file at all.
Can someone tell me the proper way to use the password-file flag? What is the correct syntax to use for the credentials in the password file?
You need to first setup the following environment variables with the credentials you can find in the dashboard on the “Buckets” page when signed into your B2 account:
Immediately underneath I would have expected something like this:
Instead of passing the B2 credentials as environment variables, restic can read them from a file. For this you need to call it with these two parameters:
As you can see I haven’t found out how to pass the account ID yet.
Edit: Actually I haven’t found out how to pass the account key either because apparently --password-file=... does not read it from the file - even when I set it, I still get an error:
Fatal: create repository at failed: Fatal: unable to open B2 backend: Key ($B2_ACCOUNT_KEY) is empty
Edit: --password-file is for the backup encryption password. I’m an idiot.
What confused me was that there simply seems to be no way to specify B2 credentials by file. That’s a bit unexpected.