-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As of version 0.29.0, the env-file directive doesn't appear to be working #435
Comments
The env file should work, I'm using it on one of my configs 🤔 Please note Could it be some permission issues? |
Just checked. I don't think so. I run resticprofile as user restic (sudo -u restic resticprofile), and that user is the owner of both the .env file and the profiles.yaml file, and all directories in the path have x permission bit set for all users and the .env file itself has rw for owner and r for all else (not what it WILL be, but as it is). |
Weirdly, I just ran resticprofile as current user, after sourcing the env file manually (and testing) and it still isn't picking up the environment variables with unchanged yaml. I will remove the env things from the yaml and test next. To confirm what I am testing against, is the syntax for templating within yaml with or without the leading #? |
I'm not too sure what you mean. You can check the resulting configuration with the For example:
|
Okay, so I run PG_DATABASES="db_a db_b db_c db_d db_infinitum"
RESTIC_REST_USERNAME=username
RESTIC_REST_PASSWORD=password Now if I run |
Got it! You need to generate the configuration to load the TBH I'm not too happy the way templates work right now but sadly it's going to take time to replace it with something more flexible |
I haven't yet tested if the |
In this snippet, I have included the section of my
profiles.yaml
file that creates a base_profile that all other profiles inherit. The dotenv file contains the username and password for the restic REST server, and a list of databases to be backed up. This file is not loaded for child processes and it is not loaded (unsure if it is meant to) for resticprofile itself. In order to work around this, I am declaring each environment variable also using theenv
directive within theprofiles.yaml
file for the moment, but this won't work for the databases, as they generate dynamic profiles based on the environment, so I will need to work around this some other way. In systemd, a unit that generates the environment is called first and this works fine, but for direct terminal usage, I will need to write a script.The text was updated successfully, but these errors were encountered: