Преглед изворни кода

Split the configuration files into 2 distinct files (home and smartphone)

jherve пре 1 месец
родитељ
комит
e3cbff43a7
5 измењених фајлова са 36 додато и 14 уклоњено
  1. 0 12
      data/borgmatic.d/config.yaml
  2. 15 0
      data/borgmatic.d/home.yaml
  3. 17 0
      data/borgmatic.d/smartphone.yaml
  4. 3 1
      data/borgmatic/common.yaml
  5. 1 1
      start.py

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

@@ -1,12 +0,0 @@
-<<: !include /etc/borgmatic/common.yaml
-
-source_directories:
-  - /mnt/source/
-
-# source_directories_must_exist: true
-
-keep_hourly: 10
-keep_daily: 7
-keep_weekly: 4
-keep_monthly: 12
-keep_yearly: 10

+ 15 - 0
data/borgmatic.d/home.yaml

@@ -0,0 +1,15 @@
+<<: !include /etc/borgmatic/common.yaml
+
+source_directories:
+  - /mnt/source/home/theenglishway/Documents/cv
+  - /mnt/source/home/theenglishway/Documents/formations/5_jours
+  - /mnt/source/home/theenglishway/Documents/job_search_campaign/jobs
+
+archive_name_format: 'home-{hostname}-{now}'
+source_directories_must_exist: true
+
+keep_hourly: 10
+keep_daily: 7
+keep_weekly: 4
+keep_monthly: 12
+keep_yearly: 10

+ 17 - 0
data/borgmatic.d/smartphone.yaml

@@ -0,0 +1,17 @@
+<<: !include /etc/borgmatic/common.yaml
+
+constants:
+  redmi_storage: "{home}/mnt/redmi/Espace de stockage interne partagé"
+
+source_directories:
+  - "{redmi_storage}/DCIM/Screenshots"
+  - "{redmi_storage}/Pictures/Messenger"
+
+archive_name_format: 'smartphone-{hostname}-{now}'
+source_directories_must_exist: true
+
+keep_hourly: 10
+keep_daily: 7
+keep_weekly: 4
+keep_monthly: 12
+keep_yearly: 10

+ 3 - 1
data/borgmatic/common.yaml

@@ -1,3 +1,6 @@
+constants:
+  home: /mnt/source/home/theenglishway
+
 repositories:
   - path: ssh://${STORAGE_BOX_USER}@${STORAGE_BOX_USER}.your-storagebox.de:23/./borg-repo
     label: hetzner
@@ -7,7 +10,6 @@ ssh_command: ssh -i ~/.ssh/${SSH_KEY_NAME}
 
 encryption_passphrase: "{credential file /credentials/borg_passphrase}"
 compression: lz4
-archive_name_format: 'backup-{hostname}-{now}'
 
 checks:
   - name: repository

+ 1 - 1
start.py

@@ -47,7 +47,7 @@ def main():
         ssh_key_name = "theenglishway.pub"
 
     volumes += [
-        f"{vol}:{to_source_path(vol)}:ro" for vol in data_sources if vol.exists()
+        f"{vol}:{to_source_path(vol)}:ro" for vol in data_sources
     ]
 
     volume_args = [a for vol in volumes for a in ["-v", vol]]