Skip to content

Instantly share code, notes, and snippets.

@aryulianto
Last active March 31, 2017 08:58
Show Gist options
  • Save aryulianto/b17848bf9e57afd2e1f51b993f2ff543 to your computer and use it in GitHub Desktop.
Save aryulianto/b17848bf9e57afd2e1f51b993f2ff543 to your computer and use it in GitHub Desktop.
script for restore backup all user zimbra
#!/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