Live Backup For Zimbra FOSS Edition

The one of weakness on zimbra FOSS edition is there’s no backup feature. Backup feature is only available for Zimbra Network Edition.

I’ve made a bash script to do a zimbra live backup for FOSS Edition. This script has been made based on this reference and this one

There are no rsync and ssh in this script, but I think we can modifying and merging this script with other scripts from the wiki page.

The goal is to do a remotely synchronization using rsync, ssh and “live” backup for zimbra open source edition.

#!/bin/bash
### START CONFIGURATION ###
DIR="/tmp/zimbra";
OUTPUT="/tmp/zimbra";
### END OF CONFIGURATION ###

USERS=`su - zimbra -c 'zmprov gaa'`;
DATE=`date +%Y%m%d`;

if [ ! -d $DIR ]; then mkdir $DIR; chown zimbra:zimbra $DIR; fi

for ACCOUNT in $USERS; do
NAME=`echo $ACCOUNT | awk -F@ '{print $1}'`;
su - zimbra -c "zmmailbox -z -m $ACCOUNT getRestURL '//?fmt=tgz' > $DIR/$NAME.tgz";
done
cd $DIR; mkdir $DATE; mv *.tgz $DATE
tar cjpf $OUTPUT/$DATE.tar.bz2 $DATE;
cd $DIR; rm -rf $DATE

or you can download the script here

Advertisement

5 Responses to “Live Backup For Zimbra FOSS Edition”


  1. 1 Ceefus November 3, 2010 at 7:31 pm

    What is this backing up? I only see it backing up the user names.. Am I missing the mail being backed up?

  2. 2 dudi November 17, 2010 at 2:13 pm

    This script back up mailbox each user

  3. 3 Mario December 23, 2010 at 5:12 am

    Hi.

    The script exports information to .tar.gz file or something like this right?, and my ask is …. after it, how I can restore each backup?

    Thanks.

  4. 4 dudi October 5, 2011 at 1:40 pm

    Mario: you can restore the backup files using restore function. you can find this function after login to your mailbox. Please check at setting/options configuration.

  5. 5 oedoed November 23, 2011 at 12:32 pm

    mas dudy mau tanya, saya coba implementasi script diatas untuk zimbra saya Release 5.0.5_GA_2201.RHEL5_20080417012110 CentOS5 FOSS edition klo dipanggil menggunakan root muncul error ERROR: service.FAILURE (system failure: GET failed, status=501 not implemented yet)
    dan klo dipanggil menggunakan user zimbra errornya Password:
    su: incorrect password
    Compressing mailbox backup, please wait…
    mv: cannot stat `*.tgz’: No such file or directory
    Zimbra mailbox backup has been completed successfully.
    adakah masukannya mas..?

    terimakasih


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




a


Follow

Get every new post delivered to your Inbox.