We're running v 5.0.7. I'm attempting to do some disk space recovery. I know under Space Admin I can go into each Space and purge trash, however, is there a way to do this from a global level?
You could...
* Install the Script Runner for Confluence
* Go to Admin -> Script Console
then paste in and run the following script:
package com.onresolve.confluence.scripts import com.atlassian.confluence.pages.TrashManager import com.atlassian.confluence.spaces.SpaceManager import com.atlassian.confluence.spaces.SpacesQuery import com.atlassian.confluence.user.AuthenticatedUserThreadLocal import com.atlassian.spring.container.ContainerManager import org.apache.log4j.Logger def log = Logger.getLogger("com.onresolve.confluence.scripting.EmptyTrashAllSpaces") def trashManager = ContainerManager.getComponent("trashManager") as TrashManager def spaceManager = ContainerManager.getComponent("spaceManager") as SpaceManager def spacesQuery = SpacesQuery.newQuery().forUser(AuthenticatedUserThreadLocal.getUser()).build() def allSpaces = spaceManager.getAllSpaces(spacesQuery) allSpaces.each {space -> log.warn("Empty trash from space: ${space.name}") trashManager.emptyTrash(space) } "Emptied trash from ${allSpaces.size()} spaces."
This is probably well worth doing periodically actually... I ran it on a copy of one of my production instances, and got back a lot of space in the database.
It can take a while... tail the log to see progress.
I'll be looking into using this! I think it really should be part of base functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This solution doesn't work as of confluence 5.9.1 since script Runner for Confluence is no longer available or working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just found that out as well. @Jamie Echlin (Adaptavist), do you know an alternative for Script Runner on Confluence or plan to deliver this from Adaptavist in the future?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We've been working on ScriptRunner for Confluence this year and we are aiming to have a release ready for Atlascamp (so about 5 weeks) all going well.
Feel free to email scriptrunner@adaptavist.com if you want more information, I can add you to a distribution list.
regards,
Mark.
ScriptRunner - PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
How can I use it in confluence 4.2.3 version ? Would it be possible to give suggestion about how to clean trash automatically? Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Denise,
I didn't found a way to do this with the current version of confluence, so I have created a feature request for you:
https://jira.atlassian.com/browse/CONF-30043
I recommend to vote and watch it to increase the chance to be implemented. I hope this helps!
Regards,
Rodrigo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pls vote for this: https://jira.atlassian.com/browse/CONF-18160 and this: https://jira.atlassian.com/browse/CONF-36075
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Hope this article, also, can help you.(https://community.atlassian.com/t5/Confluence-articles/How-to-clean-programmatically-old-drafts-and-purge-trash-with/ba-p/876791)
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.