mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 17:44:49 +02:00
Use bind mounts in sample config (#2035)
* Update docker-compose.yml * Update faq.md * chore: remove volume reference * fix: remove trailing whitespace * chore: add more verbose description Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> * gzip switch added Not all tar versions do support auto detection of compression. Co-authored-by: Frederic Werner <20406381+wernerfred@users.noreply.github.com> Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
5becce8064
commit
b6b0948095
2 changed files with 21 additions and 12 deletions
|
@ -54,16 +54,30 @@ Please do not use `CRLF`.
|
|||
|
||||
### What about backups?
|
||||
|
||||
#### Bind mounts (default)
|
||||
|
||||
From the location of your `docker-compose.yml`, create a compressed archive of your `./config` and `./data` folders:
|
||||
|
||||
```bash
|
||||
tar --gzip -cf "backup-$(date +%F).tar.gz" config data
|
||||
```
|
||||
|
||||
Then to restore `./config` and `./data` folders from your backup file:
|
||||
|
||||
```bash
|
||||
tar --gzip -xf backup-date.tar.gz
|
||||
```
|
||||
|
||||
#### Volumes
|
||||
|
||||
Assuming that you use `docker-compose` and data volumes, you can backup the configuration, emails and logs like this:
|
||||
|
||||
```sh
|
||||
# create backup
|
||||
docker run --rm -ti \
|
||||
-v maildata:/var/mail \
|
||||
-v mailstate:/var/mail-state \
|
||||
-v maillogs:/var/logs/mail \
|
||||
docker run --rm -it \
|
||||
-v "$PWD/config":/tmp/docker-mailserver \
|
||||
-v /backup/mail:/backup \
|
||||
--volumes-from mailserver \
|
||||
alpine:latest \
|
||||
tar czf "/backup/mail-$(date +%F).tar.gz" /var/mail /var/mail-state /var/logs/mail /tmp/docker-mailserver
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue