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:
32
config.yaml
32
config.yaml
@@ -51,8 +51,8 @@ keep_daily: 7
|
||||
keep_weekly: 4
|
||||
keep_monthly: 6
|
||||
|
||||
# Préfixe des archives
|
||||
prefix: "backup-"
|
||||
# Sélection des archives pour rétention (remplace 'prefix')
|
||||
match_archives: "sh:backup-*"
|
||||
|
||||
# Vérifications d'intégrité
|
||||
checks:
|
||||
@@ -64,17 +64,27 @@ checks:
|
||||
# Nombre d'archives à vérifier
|
||||
check_last: 3
|
||||
|
||||
# Commandes/hooks pour notifications
|
||||
before_actions:
|
||||
- echo "Backup démarré"
|
||||
# Commandes/hooks pour notifications (nouvelle syntaxe Borgmatic 2.0)
|
||||
commands:
|
||||
- name: "Notification de démarrage"
|
||||
when:
|
||||
- before_backup
|
||||
run:
|
||||
- echo "Backup démarré"
|
||||
|
||||
after_backup:
|
||||
- echo "Exécution hook de succès"
|
||||
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
|
||||
- name: "Notification de succès"
|
||||
when:
|
||||
- after_backup
|
||||
run:
|
||||
- echo "Exécution hook de succès"
|
||||
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
|
||||
|
||||
on_error:
|
||||
- echo "Exécution hook d'erreur"
|
||||
- /etc/borgmatic/hooks/ntfy-error.sh "{error}"
|
||||
- name: "Notification d'erreur"
|
||||
when:
|
||||
- on_error
|
||||
run:
|
||||
- echo "Exécution hook d'erreur"
|
||||
- /etc/borgmatic/hooks/ntfy-error.sh "{error}"
|
||||
|
||||
# Commandes PostgreSQL/MySQL si nécessaire
|
||||
# postgresql_databases:
|
||||
|
||||
Reference in New Issue
Block a user