From e25f2c4e6cd25e34df5c22036f7355ebc6d32c80 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 19 Jul 2019 09:25:01 -0700 Subject: [PATCH] Clarify documentation/schema about on_error hook running if there's an error in another hook (#202). --- borgmatic/config/schema.yaml | 6 ++++-- docs/how-to/add-preparation-and-cleanup-steps-to-backups.md | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index d2de3561..3957ae54 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -345,9 +345,11 @@ map: on_error: seq: - type: scalar - desc: List of one or more shell commands or scripts to execute in case an exception has occurred. + desc: | + List of one or more shell commands or scripts to execute when an exception occurs + during a backup or when running a hook. example: - - echo "Error while creating a backup." + - echo "Error while creating a backup or running a hook." umask: type: scalar desc: Umask used when executing hooks. Defaults to the umask that borgmatic is run with. diff --git a/docs/how-to/add-preparation-and-cleanup-steps-to-backups.md b/docs/how-to/add-preparation-and-cleanup-steps-to-backups.md index 48309548..273b7eb0 100644 --- a/docs/how-to/add-preparation-and-cleanup-steps-to-backups.md +++ b/docs/how-to/add-preparation-and-cleanup-steps-to-backups.md @@ -27,13 +27,13 @@ not if an error occurs in a previous hook or in the backups themselves. ## Error hooks -borgmatic also runs `on_error` hooks if an error occurs. Here's an example -configuration: +borgmatic also runs `on_error` hooks if an error occurs, either when creating +a backup or running another hook. Here's an example configuration: ```yaml hooks: on_error: - - echo "Error while creating a backup." + - echo "Error while creating a backup or running a hook." ``` ## Hook output