confluence disk space usage for a space
Asked by Anup Kumar Prasadam:

How to calculate how much disk space is used by a particular confluence space


Answers:
author: Piyush_Annadate
body: How about below macro:

Credit goes to (Developed by) Matthew Horn

```
## Macro title: Space Meta Data 2## Macro has a body: Y or N (N)## Body processing: Selected body processing option## Output: Selected output option#### Developed by: Matthew Horn, based on Space Meta Data by Andrew Frayling## Date created: 06/07/2012## Installed by: &lt;your name&gt;## Macro to display information such as number of pages, number of blog posts, attachment size, etc. about a named Space.## @param TargetSpace:title=Target space|type=string|desc=Enter the KEY of the space you want metadata for. For example, coredoc, gscontent, samples, wncontent|required=true|multiple=false## Get space details#set ( $targetSpace = $spaceManager.getSpace($paramTargetSpace) )#set ( $spaceName = $targetSpace.getName() )#set ( $spaceKey = $targetSpace.getKey() )#set ( $spaceHome = $targetSpace.getHomePage() )#set ( $spaceCreator = $targetSpace.getCreatorName() )#set ( $spaceCreationDate = $targetSpace.getCreationDate() )#set ( $spaceDescription = $targetSpace.getDescription() )#set ( $pageCount = $spaceManager.findPageTotal($targetSpace) )#set ( $blogCount = $spaceManager.getNumberOfBlogPosts($targetSpace) ) ## Get all pages in the current Space#set ( $allPagesInSpace = $pageManager.getPages($targetSpace, true) )## Reset total attachment file size#set ( $totalAttachmentFileSizeForSpace = 0 )## Reset total number of attachments#set ( $totalAttachmentCount = 0 )## Loop through all pages in the current Space#foreach ($page in $allPagesInSpace)  ## reset the attachment count for each page  #set ( $pageAttachmentCount = 0 )  ## reset the attachment file size total for each page  #set ( $totalFileSizePerPage = 0 )  ## get the attachments for each page  #set ( $allAttachments = $page.getAttachments() )  ## Loop through each attachment  #foreach ($attachment in $allAttachments)    ## Increment the attachment count for the page   #set ( $pageAttachmentCount = $pageAttachmentCount + 1 )    ## Sum the size of the attachments on the page    #set ( $totalFileSizePerPage = $totalFileSizePerPage + $attachment.getFileSize() )  #end  ## End looping through attachments  ## Increment total attachment count for the current Space  #set ( $totalAttachmentCount = $totalAttachmentCount + $pageAttachmentCount )  ## Sum the total size of attachments for the current Space  #set ( $totalAttachmentFileSizeForSpace = $totalAttachmentFileSizeForSpace + $totalFileSizePerPage )#end## End looping through pages ## Convert attachment size to MBs#set ( $attachmentSizeMb = ($totalAttachmentFileSizeForSpace / 1024.00) / 1024.00 ) ## Display Space Details&lt;table class="confluenceTable"&gt;  &lt;tbody&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Name&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$spaceName&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Key&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$spaceKey&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Description&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$spaceDescription.getBodyAsString()&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Home Page&lt;/th&gt;      &lt;td class="confluenceTd"&gt;#contentLink2($spaceHome true false)&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Created By&lt;/th&gt;      &lt;td class="confluenceTd"&gt;#usernameLink($spaceCreator) ($action.dateFormatter.formatDateTime($spaceCreationDate))&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Number of Pages&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$pageCount&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Number of Blog Posts&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$blogCount&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Number of Attachments&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$totalAttachmentCount (including all versions)&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;th class="confluenceTh"&gt;Total Size of Attachments&lt;/th&gt;      &lt;td class="confluenceTd"&gt;$attachmentSizeMb MB&lt;/td&gt;    &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;
```


author: Tom Lister
body: [@Anup Kumar Prasadam](/t5/user/viewprofilepage/user-id/361917)

Try this plugin

[https://marketplace.atlassian.com/apps/1219000/advanced-spaces-list-inventory?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/1219000/advanced-spaces-list-inventory?hosting=server&tab=overview)


author: Jaime S
body: To find out the size of the attachments in confluence, you can check the space's directory size. According to the [Hierarchical File System Attachments Storage](https://confluence.atlassian.com/display/DOC/Hierarchical+File+System+Attachment+Storage) documentation, you'll find them on the fourth level of directories, where ver003 is a the first one.

If you're using Linux or Mac, one way to find it is to find out the space's ID in the database and the do:

```
cd &lt;attachments directory&gt;/ver003find . -name &lt;space ID&gt;
```

Once you find the directory, go to it (cd again) and run:

```
du -sh .
```

If you're using Windows, you can use other tools for searching and checking the size of directories.

I hope it was helpful.

Kind regards,  
Jaime Kirch da Silveira  
Atlassian Cloud Support


author: Nic Brough -Adaptavist-
body: Iterate through every page within the space, and ask your DBAs how much the rows comprising the content and history take up, then add the size of all the attachmnets.


Tags: confluence-administration