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.


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";
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


16 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


    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?


  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..?


  6. 6 March 20, 2012 at 8:18 pm

    I’ve read a few good stuff here. Definitely value bookmarking for revisiting. I surprise how a lot attempt you put to make the sort of great informative site.

  7. 7 dudi April 19, 2012 at 3:55 pm

    #oedoed ikutan milis id-zimbra aja. biar solusinya bisa dibantu sama temen-temen yang lain 🙂

  8. 8 Kevin Cochran December 2, 2012 at 1:20 am

    Just FYI…

    As of 8.0.1, if you need to restore from this script, this will leave you with a damaged ldap database. You’ll need to use zmslapcat to export the database, then back it up. Upon restore, you’ll need to also restore your ldap database after copying everything back over.

    The reason is that in 8.0.1, Zimbra changed the ldap file structure to “allocate” the max database size. The file size appears to be 80GB by default (this can be changed), but on the disk–behind the scenes–it really only takes up the size of the data (sometimes just a few MB).

    However, the main file utilities (cp, rsync, gzip) see the allocated size as the actual file size. So a cp will actually copy 80GB instead of, say, 10MB. The result of a simple cp is a damaged file.

    So remember, use zmslapcat to export data.mdb, then backup. To restore, copy files first, then restore the data.mdb.

    For more detailed information, see here:


  9. 9 Expand your accepted currencies December 10, 2012 at 5:56 pm

    I’m not positive the place you are getting your information, but great topic. I needs to spend a while finding out more or understanding more. Thank you for great information I used to be on the lookout for this info for my mission.

  10. 10 Lesley January 20, 2013 at 2:03 am

    What’s Happening i am new to this, I stumbled upon this I’ve found
    It absolutely helpful and it has aided me out loads. I’m hoping to give a contribution & assist different customers like its helped me. Great job.

  11. 11 cloud June 28, 2013 at 1:35 am

    you’re in reality a excellent webmaster. The site loading velocity is incredible. It seems that you’re doing any unique trick.
    In addition, The contents are masterwork. you’ve performed a wonderful job on this subject!

  12. 12 Online Casinos July 16, 2013 at 8:27 am

    Greetings from Carolina! I’m bored at work so I decided to browse your site on my iphone during lunch break. I enjoy the info you provide here and can’t wait to take a look when I get
    home. I’m shocked at how quick your blog loaded on my mobile .. I’m not even using WIFI,
    just 3G .. Anyhow, superb blog!

  13. 13 horny shemale babes fucking as demon August 22, 2013 at 2:49 pm

    Hi, I do believe this is an excellent blog.
    I stumbledupon it 😉 I’m going to come back once again since I saved as a favorite it. Money and freedom is the best way to change, may you be rich and continue to help others.

  14. 14 how to hack facebook account January 3, 2014 at 1:48 am

    Now let me explain each of these one by one in brief.
    While previously only more substantial fan pages (include those
    with one-hundred thoushow to crack facebook account password or more fans) have been hacked, smaller sized
    fan pages are getting to be hacked alongside those bigger pages.
    Bronk pleaded guilty late last week, to seven felony charges.

  15. 15 June 17, 2014 at 5:22 pm

    I know this website gives quality depending articles and extra
    stuff, is there any other web page which offers these stuff in quality?

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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


%d bloggers like this: