Setting up Backblaze with Restic (Windows 10)

Not sure what I’m doing wrong but I got an error, here’s my commands minus sensitive info:

C:\Users\Saki\Restic>Saki-Bucket-Restic-Variables.cmd

C:\Users\Saki\Restic>SET B2_ACCOUNT_ID="0------------------------"

C:\Users\Saki\Restic>SET B2_ACCOUNT_KEY="K------------------------------"

C:\Users\Saki\Restic>SET RESTIC_REPOSITORY="Saki-Bucket"

C:\Users\Saki\Restic>SET RESTIC_PASSWORD_FILE=C:\Users\Password.txt

C:\Users\Saki\Restic>restic init
Fatal: create repository at "Saki-Bucket" failed: ReadDir: open \\?\C:\Users\Saki\Restic\"Saki-Bucket"\keys: The filename, directory name, or volume label syntax is incorrect.

I just made a fresh application key on B2 and copy pasted everything. Hmm.

i believe that
SET RESTIC_REPOSITORY="Saki-Bucket"
should be
SET RESTIC_REPOSITORY="b2:Saki-Bucket"

I got a different error:

C:\Users\Saki\Restic>Saki-Bucket-Restic-Variables.cmd

C:\Users\Saki\Restic>SET B2_ACCOUNT_ID="0------------------------"

C:\Users\Saki\Restic>SET B2_ACCOUNT_KEY="K------------------------------"

C:\Users\Saki\Restic>SET RESTIC_REPOSITORY="b2:Saki-Bucket"

C:\Users\Saki\Restic>SET RESTIC_PASSWORD_FILE=C:\Users\Password.txt

C:\Users\Saki\Restic>restic init
Fatal: create repository at "b2:Saki-Bucket" failed: invalid backend
If the repository is in a local directory, you need to add a `local:` prefix

And I do have a bucket with this name in B2:

so you are using s3 to access b2, correct?
then as per the restic docs, i think you need to
setup the repo using s3:, not b2:

“”"
Follow the documentation to generate S3-compatible access keys and then setup restic as described at Amazon S3. This is expected to work better than using the Backblaze B2 backend directly.
“”"

I’m not sure that I am using S3. I only recently learned of the concept of S3.

How would I know?

this is a basic dos/cmd issue; need to use correct dos/cmd syntax for declaring variables.
https://ss64.com/nt/set.html

remove the quotes from all of the variables.
for example,
SET RESTIC_REPOSITORY="b2:Saki-Bucket"
should be
SET RESTIC_REPOSITORY=b2:Saki-Bucket

tho if you must use quotes, then use this format
SET "RESTIC_REPOSITORY=b2:Saki-Bucket"

here is some terminal output

this example, works, quotes are not used for RESTIC_REPOSITORY

set RESTIC_REPOSITORY=b2:zorkzork 

restic init 
created restic repository 81e938174b at b2:zorkzork
Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is irrecoverably lost.

this example, does NOT work, quotes are used for RESTIC_REPOSITORY

set RESTIC_REPOSITORY="b2:zorkzork" 

restic init 
Fatal: create repository at "b2:zorkzork" failed: invalid backend
If the repository is in a local directory, you need to add a `local:` prefix
1 Like

Thank you all so much. I have a repo running in B2. Closing topic now and assigning solution.

1 Like