Calculate Site Size in Alfresco

Alfresco share is a collaboration platform on top of alfresco repository. In previous articles we had seen what features it provides. We had also seen some of the customization in alfresco share. Let us consider a case where organization started using Alfresco share heavily and using all its collaboration features. There are multiple sites already created and users are using them to store their contents. Now once contents being added to the site, its size grows and, in the backend, content store size on the hard disk also increased. There is a requirement where the admin wants to know the actual size or hard disk space occupied by a particular site. How could we do that?

Recently there was a thread on alfresco forum where one user had this kind of requirement and he had implemented it successfully as I found this very useful use case and alfresco does not provide any out of box support for this I though it worth sharing solution.

Using CMIS we can implement it as follow

This is a Groovy script from the CMIS & Apache Chemistry in Action book that dumps the descendants of a folder:

This could be consumed in dashlet and we could create nice dashlet which shows space occupied by each site. In above code we are passing hard coded site noderef which could be replaced by site name and then search noderef based on siteid to make it dynamic and generic. Thank you Jeff and fedemori for sharing such valuable information.

Author Spotlight

mitpatoliya

I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.