borg icon indicating copy to clipboard operation
borg copied to clipboard

Add BORG_LOCK_WAIT environment variable

Open rsyring opened this issue 5 years ago • 3 comments

To compliment the --lock-wait option?

rsyring avatar Aug 02 '20 01:08 rsyring

could be done, you would need to give the option rather often without the env var?

ThomasWaldmann avatar Aug 02 '20 19:08 ThomasWaldmann

Exactly. The way my code is written, we are already using environment variables for each command to set the passphrase and remote path. It would be cleanest to be able to include this setting in the environment vars.

Perhaps, the options system could be augmented to always look for an environment variable that matches one of the common options. So, lock-wait option automatically looks for a BORG_LOCK_WAIT environment variable for it's default value. Priority of option values would come from

  1. cli value
  2. environment value
  3. Borg default

That would solve the need for this specific option but give more flexibility for other options too.

rsyring avatar Aug 03 '20 18:08 rsyring

Don't overengineer it. I see what you mean and it is basically ok, but no quick change to borg (and should not be home-grown either, but rather come from a library based on argparse doing that - it also relates to configurability and could also process a config file).

So for now, a simple PR to add that env var to code and docs would be welcome. master branch first, later backport to 1.1-maint.

ThomasWaldmann avatar Aug 03 '20 18:08 ThomasWaldmann