mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Edit backup script
This commit is contained in:
parent
2c3dd2adb8
commit
4556c808d7
|
@ -25,11 +25,14 @@ You should use a [data volume container](https://medium.com/@ramangupta/why-dock
|
||||||
|
|
||||||
Assuming that you use `docker-compose` and a data volume container named `maildata`, you can backup your user mails like this:
|
Assuming that you use `docker-compose` and a data volume container named `maildata`, you can backup your user mails like this:
|
||||||
|
|
||||||
docker run --rm \
|
```docker run --rm -ti \
|
||||||
--volume dockermailserver_maildata:/var/mail \
|
-v maildata:/var/mail \
|
||||||
-v "$(pwd)":/backups \
|
-v mailstate:/var/mail-state \
|
||||||
-ti tvial/docker-mailserver \
|
-v /backup/mail:/backup \
|
||||||
tar cvzf /backups/docker-mailserver-`date +%y%m%d-%H%M%S`.tgz /var/mail
|
alpine:3.2 \
|
||||||
|
tar cvzf /backup/mail-`date +%y%m%d-%H%M%S`.tgz /var/mail /var/mail-state
|
||||||
|
|
||||||
|
find /backup/mail -type f -mtime +30 -exec rm -f {} \;```
|
||||||
|
|
||||||
### What about `mail-state` folder?
|
### What about `mail-state` folder?
|
||||||
This folder consolidates all data generated by the server itself to persist when you upgrade.
|
This folder consolidates all data generated by the server itself to persist when you upgrade.
|
||||||
|
|
Loading…
Reference in a new issue