Skip to content

Commit b2566af

Browse files
docs: add flow diagram to explain run-*
1 parent 48c822c commit b2566af

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ For the rest of the documentation, I'll be showing examples using different form
7373
* [Includes](#includes)
7474
* [Path resolution in configuration](#path-resolution-in-configuration)
7575
* [Run commands before, after success or after failure](#run-commands-before-after-success-or-after-failure)
76-
* [run before and after order during a backup](#run-before-and-after-order-during-a-backup)
76+
* [order of run\-\* during a backup](#order-of-run--during-a-backup)
7777
* [Warnings from restic](#warnings-from-restic)
7878
* [no\-error\-on\-warning](#no-error-on-warning)
7979
* [Locks](#locks)
@@ -688,7 +688,7 @@ Additionally, for the `run-after-fail` commands, these environment variables wil
688688
The commands of `run-finally` get the environment of `run-after-fail` when `run-before`, `run-after` or `restic` failed.
689689
Failures in `run-finally` are logged but do not influence environment or return code.
690690

691-
## run before and after order during a backup
691+
## order of `run-*` during a backup
692692

693693
The commands will be running in this order **during a backup**:
694694
- `run-before` from the profile - if error, go to `run-after-fail`
@@ -700,6 +700,10 @@ The commands will be running in this order **during a backup**:
700700
- `run-finally` from the backup section - if error, log and continue with next
701701
- `run-finally` from the profile - if error, log and continue with next
702702

703+
Maybe it's easier to understand with a flow diagram:
704+
705+
![run flow diagram](https://github.com/creativeprojects/resticprofile/raw/master/run-flow.svg)
706+
703707
# Warnings from restic
704708

705709
Until version 0.13.0, resticprofile was always considering a restic warning as an error. This will remain the **default**.

run-flow.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
```mermaid
3+
graph TD
4+
PRB('run-before' from profile) -->|Success| BRB('run-before' from backup section)
5+
PRB -->|Error| FAIL('run-after-fail')
6+
BRB -->|Error| FAIL('run-after-fail')
7+
BRB -->|Success| RUN(run restic backup with check and/or retention if configured)
8+
RUN -->|Success| BRA
9+
RUN -->|Error| FAIL('run-after-fail')
10+
BRA('run-after' from backup section)
11+
BRA -->|Success| PRA
12+
BRA -->|Error| FAIL('run-after-fail')
13+
PRA('run-after' from profile)
14+
PRA -->|Success| BRF
15+
PRA -->|Error| FAIL('run-after-fail')
16+
BRF('run-finally' from backup section)
17+
BRF --> PRF
18+
PRF('run-finally' from profile)
19+
FAIL --> BRF
20+
```

0 commit comments

Comments
 (0)