Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt
hiddentrue

Find the filesystem path for Confluence attachments.

 Sometimes we'd like to know where on the filesystem a particular Confluence attachment is. For example, after doing upgrades or maintenance, one might like to check that all attachments are present.

...

Code Block
cat /tmp/confattachments.sql | psql confluence -tAq | while IFS='|' read path filesize pageurl atturl ; do test -f /var/atlassian/application-data/confluence/current/"$path" || echo "Missing attachment $path on page $pageurl"; done

How does it work?

The official documentation on Confluence's attachment filesystem structure is Hierarchical File System Attachment Storage. At a high level, an attachment's path consists of:

...

..and that forms the core of the final SQL query presented at the beginning.

Note

JIRA has its own elaborate attachment structure nowadays too - see http://blog.valiantys.com/en/jira-en/million-jira-issues for details.