09-04-2018 03:56 AM
I have cleaned contentstore, which was about 2 GB, from user files via script
var docs = search.luceneSearch("PATH:\"/app:company_home/cm:main//*\" AND TYPE:\"doc:somecontent\"");
var i;
for (i=0; i<docs.length; i++)
{
docs[i].remove();
}//folders
var docs = search.luceneSearch("PATH:\"/app:company_home/cm:main//*\" AND TYPE:\"cm:folder\" AND NOT TYPE:\"cm:systemfolder\" AND NOT @cm\\:name:\"folder1\" AND NOT @cm\\:name:\"folder2\" AND NOT @cm\\:name:\"folder3\" AND NOT @cm\\:name:\"folder4\" AND NOT @cm\\:name:\"folder5\" AND NOT @cm\\:name:\"folder6\" ");
var i;
for (i=0; i<docs.length; i++)
{
docs[i].remove();
}
When the contentstore was empty, I emptied trashcan too.
So the trashcan is absolutely empty.
The Alfresco instance is nearly clean, but the contentstore on file system is still of 2GB size.
How is it possible to remove unused content from repository on file system?
Alfresco Community (Build: 201612)
09-04-2018 05:17 AM
I have found a solution, seems like the repository is purged by special job contentStoreCleaner:
Cleaning up orphaned content (purge) | Alfresco Documentation
And it should take by default about 14 days to purge unused content.
09-04-2018 05:17 AM
I have found a solution, seems like the repository is purged by special job contentStoreCleaner:
Cleaning up orphaned content (purge) | Alfresco Documentation
And it should take by default about 14 days to purge unused content.
09-05-2018 03:58 PM
Maybe this helps:
https://i1.wp.com/blyx.com/wp-content/uploads/2014/08/Slide1.png
In Alfresco 5 you can set this parameter for reducing this protection:
system.content.orphanProtectDays=14
Also if you apply sys:temporary aspect before deleting you will bypass the thrascan.
Regards.
--C.
Final hint: use better search.query() instead search.luceneSearch()
Explore our Alfresco products with the links below. Use labels to filter content by product module.