How to backup and restore for zimbra mailbox

In this tutorial, How to "Backup and restore for zimbra mailbox". How to backup mailbox for accounts? How to restore mailbox for accounts?
How to backup and restore for zimbra mailbox





The format list_account file as below:
[email protected]
[email protected]
The script backup mailbox for all accounts
#!/bin/bash
FILE=/tmp/list_account
DATE=$(date +"%a")
ZMBOX=/opt/zimbra/bin/zmmailbox
while read account
do
     echo "---Generating files from backup $account ---"

     $ZMBOX -z -m $account -t 0 getRestURL "//?fmt=zip" > /tmp/$acount.$DATE.zip

done < $FILE
The script restore mailbox for all accounts
#!/bin/bash
FILE=/tmp/list_account
DATE=$(date +"%a")
ZMBOX=/opt/zimbra/bin/zmmailbox
while read account
do
    echo "---Restoring files from backup $account---"
    $ZMBOX -z -m $account -t 0 postRestURL "//?fmt=zip&resolve=reset" /tmp/$account.$DATE.zip
done < $FILE
Note: if you setup multi-server Zimbra with multi-domain, How to backup and restore without split DNS? :)

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6