From 83b0be5ae5abecd2076cab8b7ab2a84e9756034a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 28 May 2019 00:46:24 -0300 Subject: Add backup routing before possibly tearing down machine Create a new backup entry before running =terraform apply=, which may (or may not) destroy the current machine. This shouldn't be an issue for the backup itself, since all of the data should be stored in a separate Block Storage Volume, but we can take advantage of the sevices already needing to be taken down in order to perform a full backup of the data. --- run-backup-template.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 run-backup-template.sh (limited to 'run-backup-template.sh') diff --git a/run-backup-template.sh b/run-backup-template.sh new file mode 100755 index 0000000..34184b9 --- /dev/null +++ b/run-backup-template.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +export BORG_REMOTE_PATH="${BORG_REMOTE_PATH}" +export BORG_PASSPHRASE="${BORG_PASSPHRASE}" +borg create \ + --verbose \ + --stats \ + --progress \ + --compression lzma,6 \ + "${BORG_REPO}::{hostname}-{now}-${VPS_COMMIT_SHA}" \ + "${VOLUME_HOME}" -- cgit v1.3