Browse Source

nouveau fichier : zimbra/Migration/3_exports_mailboxes.sh

nouveau fichier : zimbra/Migration/5_exports_filters_and_sig.sh
	nouveau fichier : zimbra/Migration/6_imports_filters_and_sig.sh
master
Sébastien Faton 12 months ago
parent
commit
1e57be5293
  1. 19
      zimbra/Migration/3_exports_mailboxes.sh
  2. 25
      zimbra/Migration/5_exports_filters_and_sig.sh
  3. 21
      zimbra/Migration/6_imports_filters_and_sig.sh

19
zimbra/Migration/3_exports_mailboxes.sh

@ -0,0 +1,19 @@
#!/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 terminée'"
echo "Lancer import sur serveur de destination"
exit;
fi

25
zimbra/Migration/5_exports_filters_and_sig.sh

@ -0,0 +1,25 @@
#!/bin/bash
RCODE=$?
echo "Export des Filtres"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Exporting Filters : $user" ; 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 echo "Exporting Default Signature : $user" ; 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
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

21
zimbra/Migration/6_imports_filters_and_sig.sh

@ -0,0 +1,21 @@
#!/bin/bash
RCODE=$?
echo "Import des Filtres"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Importation des filtres : $user"; zmprov ma $user zimbraMailSieveScript "`cat /opt/zimbra/nfsbackup/migration/filters/$user-filters.txt`";done
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'import des filtres'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Import des signatures"
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Import des signatures: $user"; zmprov csig $user default zimbraPrefMailSignatureHTML "`cat /opt/zimbra/nfsbackup/migration/sig/$user-sig.txt`";done
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'import des Signatures'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "Import terminée'"
exit;
fi
fi
Loading…
Cancel
Save