diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-05-15 13:58:42 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-08 09:03:00 +0200 |
commit | 030305fc22b16851935de4dc52f912c550bdbd09 (patch) | |
tree | 3153888a7d1b63468194f0e8334ffbf4ef63dbea /ansible/roles/borg-client/templates/bin/tergum | |
parent | 4bd33c6a46f57f8a830042795cfaa68ef91963a9 (diff) | |
download | infra-030305fc22b16851935de4dc52f912c550bdbd09.tar.gz infra-030305fc22b16851935de4dc52f912c550bdbd09.tar.bz2 infra-030305fc22b16851935de4dc52f912c550bdbd09.tar.xz infra-030305fc22b16851935de4dc52f912c550bdbd09.zip |
o New borg.
Diffstat (limited to 'ansible/roles/borg-client/templates/bin/tergum')
-rw-r--r-- | ansible/roles/borg-client/templates/bin/tergum | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ansible/roles/borg-client/templates/bin/tergum b/ansible/roles/borg-client/templates/bin/tergum new file mode 100644 index 0000000..eaab95c --- /dev/null +++ b/ansible/roles/borg-client/templates/bin/tergum @@ -0,0 +1,24 @@ +#!/bin/bash + +set -euo pipefail + +cd / + +instance=$1; shift + +echo BORG_RSH="$BORG_RSH" +echo BORG_REPO="$BORG_REPO" + +echo "Doing backup for instance $instance" + +cmd=() +cmd+=(borg create) +cmd+=("--stats") +cmd+=("--exclude-from=/etc/tergum/jobs/$instance/excludes") +cmd+=("--patterns-from=/etc/tergum/jobs/$instance/patterns") +cmd+=("::{hostname}-{now:%Y-%m-%dT%H:%M:%S}") + +set -x +time "${cmd[@]}" + +borg info --last 1 |