Backup of Zimbra MailBox using zmmailbox

This is a short script I use to backup the Zimbra mailbox content for my users.
This has been used on a Zimbra Collaboration Server (ZCS Open Source Edition) 7.2 installation, but should work on earlier versions as well.
I use another script to backup the whole Zimbra installation, but that might be another blog post.


#!/bin/bash -x
# Backup of Zimbra mailboxes using zmmailbox
# Restore of mailbox should be performed using:
# /opt/zimbra/bin/zmmailbox -z -m user@host postRestURL -u https://HOST "//?fmt=tgz&resolve=skip" mailbox-name-date.tgz
BackupFolder="/backup/zimbra"
MailBox="user1 user2 user3 userN"
DateToday=`date -I`
for name in $MailBox
do
sudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m $name@pario.no getRestURL "//?fmt=tgz" > mailbox-$name-$DateToday.tgz
done

The backup files are named mailbox-user1-20120802.tgz mailbox-user2-20120802.tgz …

16 Comments

  1. Nic 29. October 2012 Reply
  2. Hans-Henry JakobsenAuthor 29. October 2012 Reply
  3. Steve 10. December 2012 Reply
  4. Renzo 28. November 2013 Reply
    • Hans-Henry JakobsenAuthor 28. November 2013 Reply
  5. radani 15. December 2013 Reply
    • Hans-Henry JakobsenAuthor 15. December 2013 Reply
  6. Hans-Henry JakobsenAuthor 15. December 2013 Reply
  7. Vin 8. May 2014 Reply
    • Hans-Henry JakobsenAuthor 8. May 2014 Reply
  8. rj 2. July 2014 Reply
    • Hans-Henry JakobsenAuthor 3. July 2014 Reply
      • rj 4. July 2014 Reply
  9. rj 18. September 2014 Reply
    • Hans-Henry JakobsenAuthor 23. September 2014 Reply
  10. Wellington Torrejais da Silva 27. July 2015 Reply

Leave a Reply