2018-01-14 12:49:22 +01:00
|
|
|
### Backup
|
|
|
|
|
|
|
|
You can use the provided script `helper-scripts/backup_and_restore.sh` to backup mailcow automatically.
|
|
|
|
|
|
|
|
Please do not copy this script to another location.
|
|
|
|
|
|
|
|
To run a backup, write "backup" as first parameter and either one or more components to backup as following parameters.
|
|
|
|
You can also use "all" as second parameter to backup all components.
|
|
|
|
|
|
|
|
```
|
|
|
|
# Syntax:
|
2018-10-13 22:59:59 +02:00
|
|
|
# ./helper-scripts/backup_and_restore.sh backup (crypt|vmail|redis|rspamd|postfix|mysql|all)
|
2018-01-14 12:49:22 +01:00
|
|
|
|
|
|
|
# Backup all
|
|
|
|
./helper-scripts/backup_and_restore.sh backup all
|
|
|
|
|
|
|
|
# Backup vmail and mysql data
|
2018-07-01 18:06:29 +02:00
|
|
|
./helper-scripts/backup_and_restore.sh backup vmail mysql
|
2018-01-14 12:49:22 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
The script will ask you for a backup location. Inside of this location it will create folders in the format "mailcow_DATE".
|
|
|
|
You should not rename those folders to not break the restore process.
|
|
|
|
|
|
|
|
To run a backup unattended, define BACKUP_LOCATION as environment variable before starting the script:
|
|
|
|
|
|
|
|
```
|
|
|
|
BACKUP_LOCATION=/opt/backup /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all
|
|
|
|
```
|