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.

24 lines
609 B

  1. #!/bin/bash
  2. RCODE=$?
  3. if [ ! whoami = "zimbra" ]; then
  4. echo "Le user doit être zimbra, pas root ! "
  5. exit 1;
  6. fi
  7. echo "Export mailboxes :"
  8. for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
  9. do
  10. 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;
  11. done
  12. if [ $RCODE -eq 1 ]; then
  13. echo "erreur dans l'export'"
  14. exit 1;
  15. fi
  16. if [ $RCODE -eq 0 ]; then
  17. echo "Export terminée'"
  18. echo "Lancer import sur serveur de destination"
  19. exit;
  20. fi