Merge pull request #27 from levinus/patch-1

Make backup scripts cron executable
Dieser Commit ist enthalten in:
Phoenix Eve Aspacio 2017-06-14 05:47:21 +08:00 committet von GitHub
Commit 56eba211b4
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ This line backups the vmail directory to a file backup_vmail.tar.gz in the mailc
cd /path/to/mailcow-dockerized cd /path/to/mailcow-dockerized
source mailcow.conf source mailcow.conf
DATE=$(date +"%Y%m%d_%H%M%S") DATE=$(date +"%Y%m%d_%H%M%S")
docker run --rm -it -v $(docker inspect --format '{{ range .Mounts }}{{ if eq .Destination "/var/vmail" }}{{ .Name }}{{ end }}{{ end }}' $(docker-compose ps -q dovecot-mailcow)):/vmail -v ${PWD}:/backup debian:jessie tar cvfz /backup/backup_vmail.tar.gz /vmail docker run --rm -i -v $(docker inspect --format '{{ range .Mounts }}{{ if eq .Destination "/var/vmail" }}{{ .Name }}{{ end }}{{ end }}' $(docker-compose ps -q dovecot-mailcow)):/vmail -v ${PWD}:/backup debian:jessie tar cvfz /backup/backup_vmail.tar.gz /vmail
``` ```
You can change the path by adjusting ${PWD} (which equals to the current directory) to any path you have write-access to. You can change the path by adjusting ${PWD} (which equals to the current directory) to any path you have write-access to.

Datei anzeigen

@ -4,7 +4,7 @@
cd /path/to/mailcow-dockerized cd /path/to/mailcow-dockerized
source mailcow.conf source mailcow.conf
DATE=$(date +"%Y%m%d_%H%M%S") DATE=$(date +"%Y%m%d_%H%M%S")
docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql docker-compose exec -T mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql
``` ```
## Restore ## Restore