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.

15 lines
509 B

  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" ;#echo "Exporting mailbox $user" ;
  7. 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&resolve=modify" > /opt/zimbra/nfsbackup/migration/archives/$user.tgz ;
  8. done
  9. if [ $RCODE -eq 1 ]; then
  10. echo "erreur dans l'export'"
  11. exit 1;
  12. fi