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:
16
config.yaml
16
config.yaml
@@ -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}"
|
||||||
|
|||||||
Reference in New Issue
Block a user