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.
# 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
MailBox="user1 user2 user3 userN"
for name in $MailBox
sudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m $email@example.com getRestURL "//?fmt=tgz" > mailbox-$name-$DateToday.tgz
The backup files are named mailbox-user1-20120802.tgz mailbox-user2-20120802.tgz …