diff --git a/scripts/consul b/scripts/consul new file mode 100644 index 0000000..99a24a9 --- /dev/null +++ b/scripts/consul @@ -0,0 +1,19 @@ +#!/bin/bash + +hook_check() { + : +} + +hook_pre() { + consul snapshot save /etc/restore/consul.snap +} + +hook_post() { + : +} + +case "$1" in + before_check) hook_check;; + before_backup) hook_pre;; + after_backup) hook_post;; +esac diff --git a/templates/config.yaml.tpl b/templates/config.yaml.tpl index 2c8851b..31f05d0 100644 --- a/templates/config.yaml.tpl +++ b/templates/config.yaml.tpl @@ -336,7 +336,7 @@ hooks: # before_backup: # - echo "Starting a backup." before_backup: - - run-parts /etc/borgmatic/prebackup.d + - run-parts -a before_backup /etc/borgmatic/prebackup.d # List of one or more shell commands or scripts to execute # before pruning, run once per configuration file. @@ -358,7 +358,7 @@ hooks: # after_backup: # - echo "Finished a backup." after_backup: - - run-parts /etc/borgmatic/postbackup.d + - run-parts -a after_backup /etc/borgmatic/postbackup.d # List of one or more shell commands or scripts to execute # after pruning, run once per configuration file.