大网数据广告活动
服务器运维问答

Backing up Zimbra 8.0.x, data.mdb issues

· 52CE 我爱测

When trying to create a backup of zimbra open source edition 8.0.1+ I ran into issues with data.mdb 'exploding'. While my /opt/zimbra directory is only about 8GB my backup is around 80GB. both rsync and copy fail to work properly…

问题原文

原帖链接 · HTDutchy · CC BY-SA 3.0

When trying to create a backup of zimbra open source edition 8.0.1+ I ran into issues with data.mdb 'exploding'.

While my /opt/zimbra directory is only about 8GB my backup is around 80GB.

both rsync and copy fail to work properly.

已采纳解答

原帖链接 · HTDutchy · CC BY-SA 3.0

The data.mdb file is actually a thin provisioned 86GB (by default) file.
Rsync and sometimes cp commands will 'explode' the file to it's full size when copying to a backup directory.
This obviously doesn't help if you want to create an offsite backup or if you are limited in resources.

This behavior seems new in 8.0.1

The proper way to prevent this is to split your backup into 3 parts. Below my example backup script (to be executed as root).

Frist Stop zimbra and kill whatever is left.

#!/bin/bash
# Zimbra Backup Script
echo 'Starting Zimbra backup script'
date
echo 'Stopping Zimbra'
su zimbra -c '/opt/zimbra/bin/zmcontrol stop'
echo 'Kill Zimbra'
ps auxww | grep zimbra

Next backup the /opt/zimbra directory EXCLUDING the /opt/zimbra/data/ldap directory.

echo 'Saving base'
rsync -aHK --delete --exclude '*data/ldap*' /opt/zimbra/ /backup/zimbra-base

Next convert the ldap files into ldif files with the build in zmslapcat command.
You can choose to first start the server again as this command can be ran while zimbra is running. but just to be sure we get a backup of a frozen environment we'll leave it stopped for now.

echo 'Saving ldap config'
su zimbra -c '/opt/zimbra/libexec/zmslapcat -c /backup/zimbra-ldap'
echo 'Saving ldap main'
su zimbra -c '/opt/zimbra/libexec/zmslapcat /backup/zimbra-ldap'
echo 'Restarting zimbra'
su zimbra -c '/opt/zimbra/bin/zmcontrol start'
echo 'Finished'

This script was tested on zimbra 8.0.1 under ubuntu server 14.04.
It should work on most distributions and versions above 8.0.1

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-04-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。