Quote:
Originally Posted by mpereira Hi support.
It is possible to backup emails from mailboxes and restore independently equally
I need backup mailboxes independently by users, in case of loss or failure of these in a notebook recovered historically.
Mauro! |
I have a script to backup all Zimbra mailbox into separated .tgz file for each account, just modify script to meet with your requirement.
Code:
#!/bin/bash
### START CONFIGURATION ###
DIR="/tmp/zimbra";
OUTPUT="/tmp/zimbra";
### END OF CONFIGURATION ###
USERS=`su - zimbra -c 'zmprov -l 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 The above script will looping fo each account, making backup to the specified folder and then making a compressed file for the folder and it's content. Modify the above script if you want to backup specified account only.
Hope it helps, please let me know if you encounter any problem regarding the script.