Last active
March 31, 2017 08:58
-
-
Save aryulianto/b17848bf9e57afd2e1f51b993f2ff543 to your computer and use it in GitHub Desktop.
script for restore backup all user zimbra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BACKUPDIR="/srv/backup/xxxxx"; | |
clear | |
echo "Retrieve all zimbra user name..." | |
USERS=`su - zimbra -c 'zmprov -l gaa | sort'`; | |
for ACCOUNT in $USERS; do | |
NAME=`echo $ACCOUNT`; | |
echo "Restoring $NAME mailbox..." | |
su - zimbra -c "zmmailbox -z -m $NAME postRestURL '//?fmt=tgz&resolve=reset' $BACKUPDIR/$NAME.tgz"; | |
done | |
echo "All mailbox has been restored sucessfully" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment