borgapi
borgapi copied to clipboard
borgapi stucks on borgbackup questions
If you start a borgbackup commands which leads to a question, e.g. you have moved the repository. Borgapi stucks, as the questions gets never answered. Borgbackup supports environment variable to answer the questions "programmatically". https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables -> "Some automatic “answers” (if set, they automatically answer confirmation questions):"
Borgapi supports setting the environment variables, but I didn't find any hint in documentation to set the environment variables to avoid this situation. I can imagine 2 possible solutions:
- add a hint to set the environment variables to avoid the situation
- preferred solution: Set the variables to a "safe" default, answering no and additionally add a hint in the readme to change the answers
- preferred solution: Set the variables to a "safe" default, answering no and additionally add a hint in the readme to change the answers
I agree with this solution, check to see if those variables have been set already and if not setting them to NO would be a good solution.
I think allowing those to be set during creation of the API instead of requiring the user to call set_environ() would be a good idea too.