Rework logging/verbosity system #90

Merged
witten merged 12 commits from :master into master 2018-09-08 20:53:38 +00:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 8612fa4975 - Show all commits

2
NEWS
View File

@ -1,5 +1,5 @@
1.2.1.dev0
*
* Skip before/after backup hooks when only doing --prune, --check, --list, and/or --info.
1.2.0
* #61: Support for Borg --list option via borgmatic command-line to list all archives.

View File

@ -115,7 +115,9 @@ def run_configuration(config_filename, args): # pragma: no cover
local_path = location.get('local_path', 'borg')
remote_path = location.get('remote_path')
borg_create.initialize_environment(storage)
hook.execute_hook(hooks.get('before_backup'), config_filename, 'pre-backup')
if args.create:
hook.execute_hook(hooks.get('before_backup'), config_filename, 'pre-backup')
for unexpanded_repository in location['repositories']:
repository = os.path.expanduser(unexpanded_repository)
@ -166,7 +168,8 @@ def run_configuration(config_filename, args): # pragma: no cover
remote_path=remote_path,
)
hook.execute_hook(hooks.get('after_backup'), config_filename, 'post-backup')
if args.create:
hook.execute_hook(hooks.get('after_backup'), config_filename, 'post-backup')
except (OSError, CalledProcessError):
hook.execute_hook(hooks.get('on_error'), config_filename, 'on-error')
raise