Overview Hooks Excluding Files Forget Policy Cron Docker Volumes
autorestic supports docker volumes directly, without needing them to be mounted to the host filesystem.
Available since version 0.13
Let see an example.
1version: '3.7'
2
3volumes:
4 data:
5 name: my-data
6
7services:
8 api:
9 image: alpine
10 volumes:
11 - data:/foo/bar
1locations:
2 hello:
3 from: 'volume:my-data'
4 to:
5 - remote
6 options:
7 forget:
8 keep-last: 14 # Useful for limitations explained belowd
9
10backends:
11 remote: ...
Now you can backup and restore as always.
1autorestic -l hello backup
1autorestic -l hello restore
If the volume does not exist on restore, autorestic will create it for you and then fill it with the data.
Unfortunately there are some limitations when backing up directly from a docker volume without mounting the volume to the host:
If you are curious or have ideas how to improve this, please read more here. Any help is welcomed 🙂