|
|
@ -18,7 +18,7 @@ from borgmatic.borg import list as borg_list |
|
|
|
from borgmatic.borg import prune as borg_prune |
|
|
|
from borgmatic.commands.arguments import parse_arguments |
|
|
|
from borgmatic.config import checks, collect, convert, validate |
|
|
|
from borgmatic.hooks import command, healthchecks, postgresql |
|
|
|
from borgmatic.hooks import command, cronitor, healthchecks, postgresql |
|
|
|
from borgmatic.logger import configure_logging, should_do_markup |
|
|
|
from borgmatic.signals import configure_signals |
|
|
|
from borgmatic.verbosity import verbosity_to_log_level |
|
|
@ -56,6 +56,9 @@ def run_configuration(config_filename, config, arguments): |
|
|
|
healthchecks.ping_healthchecks( |
|
|
|
hooks.get('healthchecks'), config_filename, global_arguments.dry_run, 'start' |
|
|
|
) |
|
|
|
cronitor.ping_cronitor( |
|
|
|
hooks.get('cronitor'), config_filename, global_arguments.dry_run, 'run' |
|
|
|
) |
|
|
|
command.execute_hook( |
|
|
|
hooks.get('before_backup'), |
|
|
|
hooks.get('umask'), |
|
|
@ -108,6 +111,9 @@ def run_configuration(config_filename, config, arguments): |
|
|
|
healthchecks.ping_healthchecks( |
|
|
|
hooks.get('healthchecks'), config_filename, global_arguments.dry_run |
|
|
|
) |
|
|
|
cronitor.ping_cronitor( |
|
|
|
hooks.get('cronitor'), config_filename, global_arguments.dry_run, 'complete' |
|
|
|
) |
|
|
|
except (OSError, CalledProcessError) as error: |
|
|
|
encountered_error = error |
|
|
|
yield from make_error_log_records( |
|
|
@ -129,6 +135,9 @@ def run_configuration(config_filename, config, arguments): |
|
|
|
healthchecks.ping_healthchecks( |
|
|
|
hooks.get('healthchecks'), config_filename, global_arguments.dry_run, 'fail' |
|
|
|
) |
|
|
|
cronitor.ping_cronitor( |
|
|
|
hooks.get('cronitor'), config_filename, global_arguments.dry_run, 'fail' |
|
|
|
) |
|
|
|
except (OSError, CalledProcessError) as error: |
|
|
|
yield from make_error_log_records( |
|
|
|
'{}: Error running on-error hook'.format(config_filename), error |
|
|
|