From 26b25cb03c729249e2b43785607da952aa3075e7 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Fri, 3 Sep 2021 15:11:32 -0400 Subject: [PATCH] Added consul script and starting hook_api updates --- scripts/consul | 19 +++++++++++++++++++ templates/config.yaml.tpl | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 scripts/consul 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.