Fix commands syntax for Borgmatic 2.0

- Use correct 'before: action' and 'after: action' syntax instead of 'name' and 'when: [before_backup]'
- Simplify hook structure: before/after action for create, after error for failures
- Remove invalid schema fields that caused validation errors
- Commands now validate without errors

🤖 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 06:04:00 +01:00
parent df7dfe72a2
commit 9164e0273e

View File

@@ -64,24 +64,20 @@ checks:
# Nombre d'archives à vérifier # Nombre d'archives à vérifier
check_last: 3 check_last: 3
# Commandes/hooks pour notifications (nouvelle syntaxe Borgmatic 2.0) # Hooks pour notifications (syntaxe Borgmatic 2.0)
commands: commands:
- name: "Notification de démarrage" - before: action
when: when: [create]
- before_backup
run: run:
- echo "Backup démarré" - echo "Backup démarré"
- name: "Notification de succès" - after: action
when: when: [create]
- after_backup
run: 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}"
- name: "Notification d'erreur" - after: error
when:
- on_error
run: 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}"