WIP: Add locking of borgmatic config file #254
|
@ -65,8 +65,7 @@ def run_configuration(config_filename, config, arguments):
|
|||
'{}: Failed to acquire lock'.format(config_filename), error
|
||||
)
|
||||
|
||||
if not encountered_error:
|
||||
if 'create' in arguments:
|
||||
if not encountered_error and 'create' in arguments:
|
||||
try:
|
||||
|
||||
dispatch.call_hooks(
|
||||
'ping_monitor',
|
||||
|
|
|
@ -34,7 +34,7 @@ map:
|
|||
example: true
|
||||
lock_client:
|
||||
type: bool
|
||||
desc: Lock config when running borgmatic to prevent multiple instances from running simultaneously
|
||||
desc: Lock config when running borgmatic to prevent multiple instances from running simultaneously. Defaults to false.
|
||||
witten
commented
You could add: ". Defaults to false." here. See other descriptions for an example. You could add: ". Defaults to false." here. See other descriptions for an example.
|
||||
example: true
|
||||
witten
commented
The fact that it's locking the configuration file might just be an implementation detail as far as the user is concerned. What about calling this something like The fact that it's locking the configuration file might just be an implementation detail as far as the user is concerned. What about calling this something like `lock_client`, `lock_borgmatic`, etc? I don't feel strongly about this in any case.
drewkett
commented
Those sound better. I’ll fix it when I get the chance Those sound better. I’ll fix it when I get the chance
drewkett
commented
I renamed it to I renamed it to `lock_client` and left it as a bool for now. I didn't see immediately the best way to do it with the config (and validation), but if you want to keep options open switching this to something like `lock: "config"` so that then you could add a `lock: "everything` option later would be an option.
drewkett
commented
I also wasn't sure if the example line is supposed to be the default value or not. I also wasn't sure if the example line is supposed to be the default value or not.
witten
commented
A bool is fine for now, as far as I'm concerned.
A bool is fine for now, as far as I'm concerned.
`example:` is not usually the default value. In fact it's often the *opposite* of the default value in that it's demonstrating how you would override the default if you are so inclined. So `example: true` sounds right to me here, given that I'm assuming the default is `false` (don't lock).
|
||||
numeric_owner:
|
||||
type: bool
|
||||
|
|
These can be combined into a single
if
statement.