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.

35 lines
971 B

3 years ago
  1. #!/bin/bash
  2. echo "saisir le nom du compte :"
  3. read user
  4. PS3="choix du dossier d'archivage : "
  5. options=("archivage_zimbra-cli" "archivage_zimbran" "archivage_zimbra-pro-edu" "archivage_zimbrapro" "Quit")
  6. select opt in "${options[@]}"
  7. do
  8. case $opt in
  9. "archivage_zimbra-cli")
  10. echo "archivage_zimbra-cli"
  11. ;;
  12. "archivage_zimbran")
  13. echo "archivage_zimbran"
  14. ;;
  15. "archivage_zimbra-pro-edu")
  16. echo "archivage_zimbra-pro-edu"
  17. ;;
  18. "archivage_zimbrapro")
  19. echo "archivage_zimbrapro"
  20. ;;
  21. "Quit")
  22. break
  23. ;;
  24. *) echo "invalid option $REPLY";;
  25. esac
  26. break
  27. done
  28. chown zimbra:zimbra /opt/zimbra/nfsbackup/archivage/$opt/
  29. su - zimbra -c "echo 'Exporting mailbox $user' ; zmmailbox -z -m ${user} getRestURL -u 'https://127.0.0.1:7071' '//?fmt=tgz&resolve=skip' > /opt/zimbra/nfsbackup/archivage/${opt}/${user}.tgz ;"
  30. exit