You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.5 KiB

#!/bin/bash
RCODE=$?
echo "Export mailboxes :"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
do
echo "Exporting mailbox $user" ;zmmailbox -z -t 0 -m $user getRestURL -u "https://127.0.0.1:7071" "//?fmt=tgz" > /opt/zimbra/nfsbackup/migration/archives/$user.tgz ;
done
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Export des Filtres"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do zmprov ga $user zimbraMailSieveScript > filters/$user-filters.txt ;done
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/filters/*
sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/filters/*
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export des filtres'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Export des signatures"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do zmprov ga $user zimbraPrefMailSignatureHTML > sig/$user-sig.txt ;done
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/sig/*
sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/sig/*
if [ $RCODE -eq 1 ]; then
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export des Signatures'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Export terminée'"
echo "Lancer import sur serveur de destination"
exit;
fi
fi
fi