This commit is contained in:
2021-04-16 00:26:57 +02:00
parent a45eee6009
commit 952334fecb
12 changed files with 50 additions and 69 deletions

View File

@@ -2,8 +2,6 @@
Often it is usefull to trigger backups autmatically. For this we can specify a `cron` attribute to each location.
> Available since version 0.18
```yaml | .autorestic.yml
locations:
my-location:

View File

@@ -2,10 +2,6 @@
autorestic supports docker volumes directly, without needing them to be mounted to the host filesystem.
> Available since version 0.13
Let see an example.
```yaml | docker-compose.yml
version: '3.7'
@@ -22,37 +18,26 @@ services:
```yaml | .autorestic.yml
locations:
hello:
from: 'volume:my-data'
- name: hello
from: volume:my-data
to:
- remote
options:
forget:
keep-last: 14 # Useful for limitations explained belowd
backends:
remote: ...
- name: remote
# ...
```
Now you can backup and restore as always.
```bash
autorestic -l hello backup
autorestic backup -l hello
```
```bash
autorestic -l hello restore
autorestic restore -l hello
```
If the volume does not exist on restore, autorestic will create it for you and then fill it with the data.
## Limitations
Unfortunately there are some limitations when backing up directly from a docker volume without mounting the volume to the host:
1. Incremental updates are not possible right now due to how the current docker mounting works. This means that it will take significantely more space.
2. Exclude patterns and files also do not work as restic only sees a compressed tarball as source and not the actual data.
If you are curious or have ideas how to improve this, please [read more here](https://github.com/cupcakearmy/autorestic/issues/4#issuecomment-568771951). Any help is welcomed 🙂
The volume has to exists whenever backing up or restoring.
> :ToCPrevNext

View File

@@ -1,6 +1,8 @@
# Hooks
Sometimes you might want to stop an app/db before backing up data and start the service again after the backup has completed. This is what the hooks are made for. Simply add them to your location config. You can have as many commands as you wish.
If you want to perform some commands before and/or after a backup, you can use hooks.
They consist of a list of `before`/`after` commands that will be executed in the same directory as the target `from`.
```yml | .autorestic.yml
locations: