mailcow backup&restore

回复
头像
admin
网站管理员
帖子: 82
注册时间: 2016-12-31, 08:39

mailcow backup&restore

帖子 admin » 2020-10-29, 14:19

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. Append --delete-days n to delete backups older than n days.

代码: 全选

# Syntax:
# ./helper-scripts/backup_and_restore.sh backup (vmail|crypt|redis|rspamd|postfix|mysql|all|--delete-days)

# Backup all, delete backups older than 3 days
./helper-scripts/backup_and_restore.sh backup all --delete-days 3

# Backup vmail, crypt and mysql data, delete backups older than 30 days
./helper-scripts/backup_and_restore.sh backup vmail crypt mysql --delete-days 30

# Backup vmail
./helper-scripts/backup_and_restore.sh backup vmail
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 MAILCOW_BACKUP_LOCATION as environment variable before starting the script:

代码: 全选

MAILCOW_BACKUP_LOCATION=/opt/backup /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all

头像
admin
网站管理员
帖子: 82
注册时间: 2016-12-31, 08:39

mailcow backup&restore

帖子 admin » 2020-10-29, 14:20

Restore
Please do not copy this script to another location.

To run a restore, start mailcow, use the script with "restore" as first parameter.

代码: 全选

# Syntax:
# ./helper-scripts/backup_and_restore.sh restore
The script will ask you for a backup location containing the mailcow_DATE folders.

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 0 访客