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.

40 lines
1.6 KiB

  1. #!/bin/bash
  2. RCODE=$?
  3. echo "Export mailboxes :"
  4. for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
  5. do
  6. 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 ;
  7. done
  8. if [ $RCODE -eq 1 ]; then
  9. echo "erreur dans l'export'"
  10. exit 1;
  11. fi
  12. if [ $RCODE -eq 0 ]; then
  13. echo "Export des Filtres"
  14. 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
  15. sed -i -e "1d" /opt/zimbra/nfsbackup/migration/filters/*
  16. sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/filters/*
  17. if [ $RCODE -eq 1 ]; then
  18. echo "erreur dans l'export des filtres'"
  19. exit 1;
  20. fi
  21. if [ $RCODE -eq 0 ]; then
  22. echo "Export des signatures"
  23. 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
  24. sed -i -e "1d" /opt/zimbra/nfsbackup/migration/sig/*
  25. sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/sig/*
  26. if [ $RCODE -eq 1 ]; then
  27. if [ $RCODE -eq 1 ]; then
  28. echo "erreur dans l'export des Signatures'"
  29. exit 1;
  30. fi
  31. if [ $RCODE -eq 0 ]; then
  32. echo "Export terminée'"
  33. echo "Lancer import sur serveur de destination"
  34. exit;
  35. fi
  36. fi
  37. fi