Basic Working with Environmental Variables Help

I’m trying to set up restic to automatically input the password for my repos when I run my script so that I don’t have to manually interfere with the process at any point.

The docs for environmental variables: list a ton of different variables…but there is no explanation of how to actually use them.

I couldn’t find any threads via google referring to how you would use them specifically in Restic, and I suspect that if I look up "environmental variables" in general, it will not be applicable to Restic. Or is it? All I can find seems totally unrelated to Restic.

Am I missing something here? Surely the syntax of how to modify these is written down somewhere.

1 Like

I like the wrapper approach.

Then I just use restic-b2/restic-s3 instead of restic and I don’t have to remember passwords or repos or anything.

1 Like

I can’t really read that, it’s probably simpler just to set the one variable.

1 Like

It depends a little bit on the language your script is written in.
If bash, simply set them in the script via export. If another language, then you’ll need to use a different syntax; the first solution you linked was for powershell.

Either way, they’re just regular environment variables, nothing specific to restic. That’s why the restic docs don’t really explain how to set them.

1 Like

Environment variables are something that is a basic feature of operating systems and hence not something we can elaborate on the basics of in the restic manual. You can check Environment variable - Wikipedia for more information.

1 Like

And why don’t you use the --password-file flag?

My logic was that I don’t want anyone to be able to automatically access all of my files on my machine, but I guess if they can access my machine it’s already over as far as that goes.

1 Like

I understand. I consulted you because I asked a similar question before and also here they answered that if a user or someone already has access or the computer with the data, the other security measures would be secondary (minus cloud or offline backup) which makes sense.