update for borgmatic 2.0

This commit is contained in:
BeauTroll
2025-12-16 05:50:03 +01:00
parent 92d9b530f3
commit 66e4cd166f
6 changed files with 173 additions and 94 deletions

View File

@@ -1,84 +1,84 @@
# Configuration Borgmatic pour backup serveur Agence66
# Compatible avec Borgmatic 1.7.7
# Configuration Borgmatic 2.0 pour backup serveur Agence66
# Compatible avec les backups Borg existants
#
# IMPORTANT: Nécessite Borgmatic ≥ 2.0.0 pour l'interpolation des variables d'environnement
location:
# Chemins sources à sauvegarder
source_directories:
- /var/www
- /srv/minecraftserver
- /srv/reddiscordbot
- /srv/waltercoiffure
- /etc
- /opt/nextcloud
- /opt/traefik
- /opt/n8n
- /opt/portainer
- /opt/uptime-kuma
- /opt/vaultwarden
- /opt/mailcow-dockerized
- /opt/netdata
- /opt/gitea
- /home
# Repository Borg - utilise la variable d'environnement
repositories:
- path: "{BORG_REPO}"
label: serveur
# Repository Borg depuis variable d'environnement
repositories:
- "{BORG_REPO}"
# Chemins sources à sauvegarder
source_directories:
- /var/www
- /srv/minecraftserver
- /srv/reddiscordbot
- /srv/waltercoiffure
- /etc
- /opt/nextcloud
- /opt/traefik
- /opt/n8n
- /opt/portainer
- /opt/uptime-kuma
- /opt/vaultwarden
- /opt/mailcow-dockerized
- /opt/netdata
- /opt/gitea
- /home
# Patterns d'exclusion
exclude_patterns:
- "*.log"
- "*/cache/*"
- "*/tmp/*"
- "**/__pycache__"
- "*/node_modules/*"
# Patterns d'exclusion
exclude_patterns:
- "*.log"
- "*/cache/*"
- "*/tmp/*"
- "**/__pycache__"
- "*/node_modules/*"
# Un seul système de fichiers
one_file_system: false
# Un seul système de fichiers
one_file_system: false
storage:
# Format du nom d'archive (compatible avec votre ancien script)
archive_name_format: "backup-{now:%Y%m%d-%H%M}"
# Format du nom d'archive (compatible avec votre ancien script)
archive_name_format: "backup-{now:%Y%m%d-%H%M}"
# Compression
compression: zstd
# Compression
compression: zstd
# Options SSH
ssh_command: ssh -o StrictHostKeyChecking=accept-new
# Options SSH
ssh_command: ssh -o StrictHostKeyChecking=accept-new
retention:
# Politique de rétention
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
# Politique de rétention
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
# Préfixe des archives
prefix: "backup-"
# Préfixe des archives
prefix: "backup-"
consistency:
# Vérifications d'intégrité
checks:
- name: repository
frequency: 2 weeks
- name: archives
frequency: 1 month
# Vérifications d'intégrité
checks:
- name: repository
frequency: 2 weeks
- name: archives
frequency: 1 month
# Fréquence des vérifications
check_last: 3
# Nombre d'archives à vérifier
check_last: 3
hooks:
# Hooks pour notifications ntfy
before_backup:
- echo "Backup démarré"
# Commandes/hooks pour notifications
before_actions:
- echo "Backup démarré"
after_backup:
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
after_backup:
- echo "Exécution hook de succès"
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
on_error:
- /etc/borgmatic/hooks/ntfy-error.sh "{error}"
on_error:
- echo "Exécution hook d'erreur"
- /etc/borgmatic/hooks/ntfy-error.sh "{error}"
# Commandes PostgreSQL/MySQL si nécessaire
# postgresql_databases:
# - name: all
# Commandes PostgreSQL/MySQL si nécessaire
# postgresql_databases:
# - name: all
# mysql_databases:
# - name: all
# mysql_databases:
# - name: all