Update 'Readme.md'

This commit is contained in:
lasimik 2021-05-17 12:35:56 +00:00
parent 8ee0e1b079
commit 8bdbe41da0
1 changed files with 3 additions and 2 deletions

View File

@ -78,7 +78,7 @@ To know when the last complete backup was made, even if there is no connection t
This example uses date and time of the last *complete* backup. Borgmatic does not supply this in a placeholder, so it is identified with `borgmatic list --successful --last 1`, returning only date and time (`--format {time}`) and without control characters (`--no-color `), then the header line is skipped (`sed -n 2p`), and the timezone (that the borgmatic return lacks) is appended (`date +'%:z'`).
It's a good idea to store this value together with the other files for that repository, so `/root/{repository}` would be nice. Unfortunately, `{repository}` is not resolved within borgmatic; the path must be manually copied from the top of the config file.
It's a good idea to store this value together with the other files for that repository, so `/root/{repository}` would be nice. Unfortunately, `{repository}` is not resolved within borgmatic; the path must be manually copied from the top of the config file and append to `/root/`.
If an error occurs during backup, a script (here, `notify-error.sh`) will read that date and time and do the subsequent processing.
@ -92,7 +92,8 @@ location:
...
hooks:
after_backup:
- echo "$(borgmatic list --successful --last 1 --format {time} --no-color | sed -n 2p) $(date +'%:z')" \
- echo "$(borgmatic list --successful --last 1 --format {time} --no-color \
| sed -n 2p) $(date +'%:z')" \
> "/root/BackupUser@BackupServer:/path/to/repository/last-successful-backup"
...
on_error: