diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-12-26 11:02:22 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-12-26 11:02:22 +0100 |
commit | 37e93cced23e0ee726309e841b1dac19e9ccdac4 (patch) | |
tree | 8c692652c0a5fdbd0d95510dabd58c95e1805541 /ansible/roles/borg-client/templates/bin | |
parent | 72811f0f48cad07351ab5c5224616383a6920add (diff) | |
download | infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.gz infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.bz2 infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.tar.xz infra-37e93cced23e0ee726309e841b1dac19e9ccdac4.zip |
o Working borg setup.
Diffstat (limited to 'ansible/roles/borg-client/templates/bin')
-rw-r--r-- | ansible/roles/borg-client/templates/bin/create-backup | 23 | ||||
-rw-r--r-- | ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup | 5 |
2 files changed, 23 insertions, 5 deletions
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 |