How to Determine the Number of Attachments in My Confluence Instance

Still need help?

The Atlassian Community is here for you.

Ask the community

How to Find the Number of Attachments in Confluence

DB level count:

To query the database for attachments, run this SQL:

Atlassian Support Offerings

The following SQL query is outside the scope of Atlassian Support Offerings and is provided for general guidance only.

For Confluence 5.7 and above
-- To get a count of current attachment versions only
select count(*) from content where contenttype = 'ATTACHMENT' and prevver is null;
 
-- To get a count of all attachment versions
select count(*) from content where contenttype = 'ATTACHMENT';
For Confluence 5.6 and below
-- To get a count of current attachment versions only
select count(*) from attachments a join content c on a.pageid = c.contentid where c.prevver is null and a.prevver is null;
 
-- To get a count of all attachment versions
select count(*) from attachments;

 

File System count:
For linux
find pathtoattachments -type f | awk -F'/' '{print $(NF-1)}' | wc -l
Last modified on Feb 23, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.