aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/borg-client/templates
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/borg-client/templates')
-rw-r--r--ansible/roles/borg-client/templates/bin/create-backup23
-rw-r--r--ansible/roles/borg-client/templates/bin/trygvis-borg-run-backup5
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