autorestic/docs/pages/examples.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

2020-05-17 14:52:30 +02:00
# 🐣 Examples
2021-04-16 00:26:57 +02:00
## List all the snapshots for all the backends
2020-05-17 14:52:30 +02:00
```bash
2021-04-21 09:41:14 +02:00
autorestic exec -av -- snapshots
2020-05-17 14:52:30 +02:00
```
2021-04-16 00:26:57 +02:00
## Unlock a locked repository
2020-05-17 14:52:30 +02:00
2021-05-01 15:18:05 +02:00
This can come in handy if a backup process crashed or if it was accidentally cancelled. Then the repository would still be locked without an actual process using it. Only do this if you know what you are doing and are sure no other process is actually reading/writing to the repository of course.
2020-05-17 14:52:30 +02:00
```bash
2020-11-13 15:48:20 +01:00
autorestic exec -b my-backend -- unlock
2020-05-17 14:52:30 +02:00
```
2022-04-12 23:59:12 +02:00
## Use hooks to integrate with [healthchecks](https://healthchecks.io/)
2022-04-13 08:55:53 +02:00
> Thanks to @olofvndrhr for providing it ❤️
2022-04-12 23:59:12 +02:00
```yaml
extras:
healthchecks: &healthchecks
hooks:
before:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/start'
failure:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup failed for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/fail'
success:
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup successful for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>'
locations:
something:
<<: *healthchecks
from: /somewhere
to:
- somewhere-else
```