King0770-Notes-Nuking everything in a folder: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{BC|Community Sandbox}} | |||
__FORCETOC__ | |||
<div class="col-md-12 ibox-content"> | |||
=King Notes nuking everything in a folder= | |||
{{KB|{{Unsupported}}|{{ZCS 7.0}}||}} | |||
{{Archive}}{{WIP}} | {{Archive}}{{WIP}} | ||
Line 27: | Line 32: | ||
http://bugzilla.zimbra.com/show_bug.cgi?id=38473 | http://bugzilla.zimbra.com/show_bug.cgi?id=38473 | ||
{{Article Footer|Zimbra Collaboration 7.0|04/16/2014}} |
Revision as of 10:03, 12 July 2015
King Notes nuking everything in a folder
This comes up once in a while in support; someone has thousands or millions of items in a folder, and they need to nuke the folder now.
Usually, the command to nuke everything in a folder is:
zmmailbox -z -m user01@domain.com ef /MyStuff
However, if the folder actually has "millions" of items in it, you may be inclined to remove 100 items at a time, and let the script run until all the items are removed.
Example:
#!/bin/bash
for msg in `zmmailbox -z -m user01@domain.com search -l 100 "in:MyStuff" | grep conv | awk '{ print $2 }' | sed -e 's/^-//'`
do
echo "Removing "$msg""
zmmailbox -z -m user01@domain.com dm $msg
done
Notable bugs:
http://bugzilla.zimbra.com/show_bug.cgi?id=38473