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.

26 lines
715 B

  1. #!/bin/bash
  2. RCODE=$?
  3. if [ $(id -u) -eq 0 ]
  4. then
  5. echo "Ce script ne doit pas être lancé en tant que root"
  6. exit 1
  7. fi
  8. echo "Export mailboxes :"
  9. for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;
  10. do
  11. echo "Exporting mailbox $user"; zmmailbox -z -t 0 -m $user getRestURL --startTime $(date -d '-3 day' +%Y/%m/%d) --endTime $(date -d '+1 day' +%Y/%m/%d) -u "https://127.0.0.1:7071" "//?fmt=tgz" > /opt/zimbra/nfsbackup/migration/archives/$user.tgz ;
  12. done
  13. if [ $RCODE -eq 1 ]; then
  14. echo "erreur dans l'export'"
  15. exit 1;
  16. fi
  17. if [ $RCODE -eq 0 ]; then
  18. echo "export terminée !!!!"
  19. echo "Passez à l'import des datas sur serveur dest"
  20. exit;
  21. fi