瀏覽代碼

Initial commit

jherve 1 月之前
當前提交
ddb26a2342
共有 2 個文件被更改,包括 59 次插入0 次删除
  1. 35 0
      data/borgmatic.d/config.yaml
  2. 24 0
      start.sh

+ 35 - 0
data/borgmatic.d/config.yaml

@@ -0,0 +1,35 @@
+source_directories:
+    - /mnt/home/theenglishway/Documents/cv
+    - /mnt/home/theenglishway/Documents/formations/5_jours
+repositories:
+    - path: ssh://u505981@u505981.your-storagebox.de:23/./borg-repo
+one_file_system: true
+remote_path: borg-1.4
+
+#   Passphase is set in varibable $BORG_PASSPHRASE
+#   encryption_passphrase: "DoNotForgetToChangeYourPassphrase"
+compression: lz4
+archive_name_format: 'backup-{hostname}-{now}'
+
+keep_hourly: 10
+keep_daily: 7
+keep_weekly: 4
+keep_monthly: 12
+keep_yearly: 10
+
+checks:
+  - name: repository
+    frequency: 2 weeks
+  - name: archives
+    frequency: always
+  - name: extract
+    frequency: 2 weeks
+  - name: data
+    frequency: 1 month
+
+before_everything:
+    - echo "Starting a backup job."
+after_everything:
+    - echo "Backup created."
+on_error:
+    - echo "Error while creating a backup."

+ 24 - 0
start.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -eu -o pipefail
+
+HOSTNAME=$(hostname)
+CONTAINER_NAME="borgmatic"
+
+# Some of those volumes seem useless, e.g. : 
+#   * the repository (which can be mounted within the container)
+#   * the cache / state volumes (which can be managed volumes instead of directories)
+#   * mounting the data to save on a precise mount point (one could have several..)
+podman run \
+  -h ${HOSTNAME} \
+  --detach \
+  --name ${CONTAINER_NAME} \
+  -v /home/:/mnt/home:ro \
+  -v ./data/repository:/mnt/borg-repository \
+  -v ./data/borgmatic.d:/etc/borgmatic.d/ \
+  -v ./data/.config/borg:/root/.config/borg \
+  -v /home/theenglishway/.ssh:/root/.ssh \
+  -v ./data/.cache/borg:/root/.cache/borg \
+  -v ./data/.state/borgmatic:/root/.local/state/borgmatic \
+  -e TZ=Europe/Paris \
+  ghcr.io/borgmatic-collective/borgmatic