Migrate to Borgmatic 2.0 syntax without deprecations

- Replace deprecated 'prefix' with 'match_archives: sh:backup-*'
- Replace deprecated hooks (before_actions, after_backup, on_error) with new 'commands' syntax
- Use structured command format with name, when, and run fields
- Removes all deprecation warnings from borgmatic config validate

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
BeauTroll
2025-12-16 05:57:14 +01:00
parent b215d8c325
commit df7dfe72a2

View File

@@ -51,8 +51,8 @@ keep_daily: 7
keep_weekly: 4 keep_weekly: 4
keep_monthly: 6 keep_monthly: 6
# Préfixe des archives # Sélection des archives pour rétention (remplace 'prefix')
prefix: "backup-" match_archives: "sh:backup-*"
# Vérifications d'intégrité # Vérifications d'intégrité
checks: checks:
@@ -64,15 +64,25 @@ checks:
# Nombre d'archives à vérifier # Nombre d'archives à vérifier
check_last: 3 check_last: 3
# Commandes/hooks pour notifications # Commandes/hooks pour notifications (nouvelle syntaxe Borgmatic 2.0)
before_actions: commands:
- name: "Notification de démarrage"
when:
- before_backup
run:
- echo "Backup démarré" - echo "Backup démarré"
after_backup: - name: "Notification de succès"
when:
- after_backup
run:
- echo "Exécution hook de succès" - echo "Exécution hook de succès"
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}" - /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
on_error: - name: "Notification d'erreur"
when:
- on_error
run:
- echo "Exécution hook d'erreur" - echo "Exécution hook d'erreur"
- /etc/borgmatic/hooks/ntfy-error.sh "{error}" - /etc/borgmatic/hooks/ntfy-error.sh "{error}"