I have tried changing the export line to: >> /path-to-tgz-file
I thought ">>" would append to the existing zip
I get a huge resultant file, but I can not open it to import to zimbra web or desktop. Is there something I am missing with this process?
If anyone has any good pointers that could help, I would greatly appreciate it.
Thanks!
Code: Select all
#!/bin/bash
# rm_message.sh user@domain.com subject
if [ -z "$2" ]; then
echo "usage: zimbra-search.sh <search string> example.com"
exit 0
else
search=$1
domain=$2
for acct in `zmprov -l gaa "$domain" | grep -E -v '(^admin@|^spam\..*@|^ham\..*@|^virus-quarantine.*@|^galsync.*@)'|sort` ; do
echo "Searching $acct for $search"
zmmailbox -z -m "$acct" s -l 999 -t message "$search"
echo "Now parsing the message id"
zmmailbox -z -m "$acct" -t 0 getRestURL '//?fmt=tgz&query=content:("$search")' > /opt/migrate/exports/"$acct".tgz
done
fi
CentOS release 6.10 (Final)
Version = Release 8.8.9_GA_3019.RHEL6_64_20180809160254 RHEL6_64 FOSS edition, Patch 8.8.9_P10.