RESTIC_REPOSITORY is the name of your b2-bucket.
ID and KEY are the keys from backblaze. as far as i remember, one of them is only shown once when you create the bucket. i also setup cache and tmp-dir, in case of /tmp is to small.
Yes, this example is for Linux Systems. I just did a quick “Windows Restic backup” Google search and got shown some GitHub projects where others have offered their Powershell script which they use to fully automate their backup.
If you would like a PowerShell script, then it’s a different syntax. You have to read up on how that works or browse the forum for Windows related topics. I bet there are various threads that will help you out.
hi, can do that but better to put all the commands into a simple text file.
can create a text file with .cmd extension.
here is a simple example file, called var.cmd
note: need to change the values to match your setup
set RESTIC_REPOSITORY="b2:restic-west02"
set RESTIC_PASSWORD=password
set B2_ACCOUNT_ID=012x11f5584568299998888zz
set B2_ACCOUNT_KEY=K012eFG6971Sshi/qrSSS897QC1dBfd
and from the command line, run the command var.cmd
now, when you run restic, it will use those parameters
so at this point, to create a new repo, is a simple as restic init
SET RESTIC_PASSWORD_FILE=/etc/restic-password
instead of set RESTIC_PASSWORD=password
I’d like to point my password to a file as well? How can I achieve this? Does the file need to be in the same directory as the .cmd file? Do I need the full file path?
i did changed that, to simply the number of steps for you.
so, if you want to use a password file,
create a text file with the password only, no newline. let’s call it c:\path\to\pwd.file
and the var.cmd would look like
set RESTIC_REPOSITORY="b2:restic-west02"
set RESTIC_PASSWORD_FILE=c:\path\to\pwd.file
set B2_ACCOUNT_ID=012x11f5584568299998888zz
set B2_ACCOUNT_KEY=K012eFG6971Sshi/qrSSS897QC1dBfd
You mean it by default looks for my bucket variable? What if I had a 2nd bucket, and wanted to create a second routine that backed up different files?
Do I have to SET a different group of variables? When I init a second repo for that 2nd bucket, how does it not get the first group of variables mixed up from the second group?
I guess I’m just having a hard time understanding the proper steps:
I guess it would be like
But how does the 2nd restic init know to use the variables that created in Saki-Restic-Variables-2.cmd?
As in the id, key, and name of that second bucket? There doesn’t seem to be a parameter to choose which bucket you’re targeting. Does Windows just magically know?
Is it because I invoked the .cmd file right before the initialization and it just takes the variables from the last thing I invoked?