From 37e93cced23e0ee726309e841b1dac19e9ccdac4 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 26 Dec 2018 11:02:22 +0100 Subject: o Working borg setup. --- .../roles/borg-client/templates/bin/create-backup | 23 ++++++++++++++++++++++ .../templates/bin/trygvis-borg-run-backup | 5 ----- 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 ansible/roles/borg-client/templates/bin/create-backup delete mode 100644 ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup (limited to 'ansible/roles/borg-client/templates/bin') diff --git a/ansible/roles/borg-client/templates/bin/create-backup b/ansible/roles/borg-client/templates/bin/create-backup new file mode 100644 index 0000000..dfbe72d --- /dev/null +++ b/ansible/roles/borg-client/templates/bin/create-backup @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +cd / + +. /etc/borg/env +export BORG_REPO +export BORG_RSH + +cmd=() +cmd+=(borg create) +cmd+=(--stats) +cmd+=(--progress) +cmd+=(--json) +cmd+=(--exclude-from=/etc/borg/excludes) +cmd+=(--patterns-from=/etc/borg/patterns) +cmd+=(::'{hostname}-{now:%Y-%m-%dT%H:%M:%S}') + +echo BORG_REPO=$BORG_REPO + +set -x +time "${cmd[@]}" diff --git a/ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup b/ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup deleted file mode 100644 index 7f3e218..0000000 --- a/ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -/usr/bin/borg -- cgit v1.2.3