Purging deleted binaries

After I removed some documents (and removed them from the trash), the contents of the binaries is still present on disk (in nxserver/data/binaries).

I can remove them using Admin Center > Repository Binaries > check Delete orphaned binaries > Mark orphaned binaries, but how can this be done programmatically?

0 votes

1 answers

4283 views

ANSWER



This can be done using Java code that you can insert in an operation:

import org.nuxeo.ecm.core.storage.sql.management.RepositoryStatus;

RepositoryStatus status = new RepositoryStatus();
if (!status.isBinariesGCInProgress()) {
    status.gcBinaries(true);
}
0 votes



It's possible to obtain the same effect with a Nuxeo Shell command? Thanks a lot
08/22/2014

You can put this in a Groovy script and execute it through the shell.
08/28/2014