Merge branch 'fix-72-hooks-are-executed-when-list-or-info' of thomasleveil/borgmatic into master
Thanks for fixing this! I agree about more specific hooks if and when `--check` or `--prune`-specific hook use cases are needed. I think what you've done here is fine until then.
This commit is contained in:
commit
4538017206
1 changed files with 5 additions and 2 deletions
|
@ -115,6 +115,8 @@ def run_configuration(config_filename, args): # pragma: no cover
|
||||||
local_path = location.get('local_path', 'borg')
|
local_path = location.get('local_path', 'borg')
|
||||||
remote_path = location.get('remote_path')
|
remote_path = location.get('remote_path')
|
||||||
borg_create.initialize_environment(storage)
|
borg_create.initialize_environment(storage)
|
||||||
|
|
||||||
|
if args.create:
|
||||||
hook.execute_hook(hooks.get('before_backup'), config_filename, 'pre-backup')
|
hook.execute_hook(hooks.get('before_backup'), config_filename, 'pre-backup')
|
||||||
|
|
||||||
for unexpanded_repository in location['repositories']:
|
for unexpanded_repository in location['repositories']:
|
||||||
|
@ -171,6 +173,7 @@ def run_configuration(config_filename, args): # pragma: no cover
|
||||||
remote_path=remote_path,
|
remote_path=remote_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if args.create:
|
||||||
hook.execute_hook(hooks.get('after_backup'), config_filename, 'post-backup')
|
hook.execute_hook(hooks.get('after_backup'), config_filename, 'post-backup')
|
||||||
except (OSError, CalledProcessError):
|
except (OSError, CalledProcessError):
|
||||||
hook.execute_hook(hooks.get('on_error'), config_filename, 'on-error')
|
hook.execute_hook(hooks.get('on_error'), config_filename, 'on-error')
|
||||||
|
|
Loading…
Reference in a new issue