The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
- Zimbra Tech Center
- Community Sandbox
- King0770-Notes-Nuking everything in a folder
King Notes nuking everything in a folder
KB 3434
|
Last updated on 2015-07-12
|
Last updated by Jorge de la Cruz
|
|
Verified in: ZCS 7.0
|
|
- This article is a Community contribution and may include unsupported customizations.
|
KB 3434
|
Last updated on 2015-07-12
|
|
|
- This article is a Community contribution and may include unsupported customizations.
|
- This is archive documentation, which means it is not supported or valid for recent versions of Zimbra Collaboration.
- This article is a Work in Progress, and may be unfinished or missing sections.
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
Try Zimbra
Try Zimbra Collaboration with a 60-day free trial.
Get it now »
Want to get involved?
You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »
Looking for a Video?
Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »