Rules and reports
The app has four rules, all in Confluence settings → Legroom. Three of them can delete: they are set on the Rules tab and are switched off after installation. The fourth only reports and is set on the Unused tab.
| Rule | What it does | Set on |
|---|---|---|
| Trash | Purges pages, blog posts and files that have been in the trash longer than a set time | Rules tab |
| Page versions | Deletes old versions of pages and blog posts | Rules tab |
| Attachment versions | Deletes old versions of files | Rules tab |
| Unused attachments | Reports files that nothing refers to | Unused tab |
How a rule works
- The app keeps an index of the site: spaces, pages, blog posts and files with their sizes, version numbers and dates. A read of the site fills it; events from Confluence and a catch-up read twice a day keep it current.
- Once an hour the app looks through the index for objects a rule applies to.
- The index only names candidates. Right before the request that deletes, the app reads the object from Confluence again: its state, its space, its labels and, where the rule needs them, its versions. On any doubt the object is skipped.
- An entry is opened in the journal before the request and closed after the answer of Confluence. An entry left open by an interrupted run is settled by the next one.
Every rule shows what it would delete before you switch deletion on. Each rule is a card on its tab, and under each rule that can delete, the line “Would purge now” or “Would delete now” counts, from the index, what the rule would delete with the values on the page, whether it deletes or not. Change opens a card, and the line counts again as a field is left. Under the Unused attachments rule the line is called “Past these periods now”. A rule deletes only while Delete automatically is ticked in its card; the card is then marked deleting, otherwise not deleting.
Switching deletion on for a rule asks at Save for a confirmation that shows what the rule would delete now. Making a rule that already deletes keep less asks Delete more? instead. The counts and the confirmation leave out spaces where the app lacks the Admin role, and name them under Not counted. Exemption labels are checked right before deletion, not by these counts, so a counted page or file can still be skipped.
Trash
Purges what has been in the trash of a space longer than the period. Purged content cannot be restored.
| Setting | Values | After installation |
|---|---|---|
| Purges what has been in the trash for more than … days | 1 to 3,650 | 30 |
- The time in the trash counts from the moment Confluence reports that the object was moved there. Confluence does not say this for objects already in the trash: for an object the app first meets in the trash, the count starts when the app first sees it. Such objects stay longer than the period says, never shorter.
- An object that changed since its time was recorded has its count started again.
- An object restored from the trash is no longer a candidate. If it is trashed again later, its time starts over.
- A page with the exemption label is not purged, and neither are its files.
- A file that the app itself moved to the trash as unused is purged only if still nothing refers to it. If a reference has appeared, the file stays in the trash and is marked needs restore on the Unused tab; a person restores it in the trash of the space.
Page versions and Attachment versions
Both rules keep the current version and delete older ones. The current version is never deleted. The Page versions rule covers pages and blog posts.
| Setting | Values | After installation |
|---|---|---|
| What it keeps besides the current version | the last … versions, or the versions replaced within the last … days | the last … versions |
| the last … versions | 0 to 10,000 | 50 for pages, 10 for files |
| the versions replaced within the last … days | 1 to 3,650 | 365 |
- The last … versions keeps the current version and that many versions before it. With 0, only the current version stays.
- The versions replaced within the last … days keeps a version for the set time after it was replaced: the age of a version counts from the moment it stopped being the current one, not from the day it was written. A page that nobody has edited for years keeps the set number of previous versions under a number rule and loses all but the current one under an age rule.
- When versions are kept by age, the count names the pages or files concerned. How many of their versions are old enough is known only when the rule reads their version lists.
- Versions are deleted oldest first, in batches of at most 20, or 25 when versions are kept by age. After each batch the app reads the object again. If somebody edited it meanwhile, the app counts anew; if versions are missing that the app did not delete, it stops and leaves the object alone.
- Confluence renumbers the versions that stay: after version 1 is deleted, the former version 2 is shown as version 1.
- Deleted versions do not go to the trash and cannot be restored.
What the two rules free is different. Pages take almost no storage, so the Page versions rule shortens the history and frees next to nothing. Files are what the storage of a Confluence site is made of: the Attachment versions rule is where most of it comes back.
Unused attachments
The rule reports files that nothing refers to. It cannot delete and moves nothing by itself: a file goes to the trash when a Confluence administrator picks it on the Unused tab. Its periods are set there, in the card Unused attachments at the top of the tab, and for a space with rules of its own in the view of the space on the Spaces tab.
A file counts as unused when it is not the cover picture of the page it is attached to and neither that page, nor a comment, a reply or an inline comment on it, nor another page refers to it.
| Setting | Values | After installation |
|---|---|---|
| nothing has referred to it for … days | 0 to 3,650 | 30 |
| it was uploaded more than … days ago | 0 to 3,650 | 90 |
| nobody has viewed it for … days | 0 to 3,650 | 90 |
The periods decide from when on a file can be picked. A file past all three has a checkbox and no status, unless one of the cases below keeps it; the others are shown as kept, with the reason. The line “Past these periods now” in the card counts the files past all three, leaving out the files of pages that keep files.
- “Nothing has referred to it for” counts from the sorting of the files that found the file unused. Read everything again, in Support tools on the Overview tab, sorts every file anew, so the count starts over for every file: right after it no file can be picked until that period has passed again, 30 days with the value set after installation.
- “Nobody has viewed it for” relies on the events Confluence sends when somebody opens the preview of a file. A page that merely shows a picture sends none. Under the time a file has been unused the list shows when it was last viewed, or “no view recorded” when the app has never received such an event for it.
- Before a file moves, the app reads it again, together with its page, the comments and the cover picture of the page. A file that is referred to, changed or labelled since stays where it is.
- A page that keeps files (five or more attachments, at least four out of five of them unreferenced) is marked page of files. Its files can be picked like any other; the mark warns that they may be kept there on purpose.
- To stay on the safe side the app treats as used: every file of a page with an Attachments or Gallery macro, of a page whose body could not be read, and of a page with more than 200 comments.
- A file in a space the rules stay out of (excluded, personal or archived) is listed and cannot be picked.
- A file the app has found with the exemption label, on the file or on its page, and a file in a space where the app lacks the Admin role are listed as kept and cannot be picked. While deletion is paused, and while the app has no active license, no file can be picked.
- Up to 100 files can be moved with one request. The limits per run and per day and the pause apply to them as to the rules.
Moving a file to the trash is the only action of the app that can be undone: the file stays in the trash of its space and can be restored there by a person.
Where rules apply
- All spaces follow the global rules of the Rules tab, with two exceptions: personal spaces and archived spaces are left alone.
- Per space, on the Spaces tab, Edit under the name of a space opens its view. Rules in this space offers three choices: “Global rules: the rules of the Rules tab”, “Rules of its own, in place of the global rules” and “No rules: nothing is deleted in this space”. A personal or archived space that gets the global rules or rules of its own is included. A choice that lets rules which delete act in the space asks for the same confirmation as switching deletion on, and every change goes to the journal.
- Rules of its own take the place of the global rules there as a whole. With No rules they are kept for later; with the global rules they are dropped.
- The view of a space stores its rules and its quota under one Save, and only while the settings of the space are as they were when the view was opened. A save over settings changed meanwhile, for example by a space administrator who switched the rules off, is refused with a message and stores nothing.
- The app acts only where it has the Admin role in the space, and only on what it can see. Pages restricted to certain people are invisible to it.
What protects content
| Protection | Effect |
|---|---|
Exemption label, retention-exempt unless changed |
Every rule skips a page with the label, together with its files, also in the trash. On a single file it protects that file. Labels that cannot be read in full count as “exempt”. |
| A space set to No rules | No rule touches the space. |
| At most … deletions per run | 1 to 5,000; 500 after installation. Files moved to the trash by hand count as well. |
| At most … deletions per day | 1 to 100,000; 5,000 after installation. Files moved to the trash by hand count as well. |
| Pause all deletion | Stops every deletion at once, after a confirmation, moving picked files to the trash included. Reports keep working. Resume deletion in the message above the tabs asks before lifting it. |
| License | Without an active license nothing is deleted and no file is moved to the trash. A license the app cannot read counts as none. |
The exemption label accepts 1 to 255 letters, digits, hyphens, underscores or slashes. Leading and trailing spaces are removed, and letters are stored in lower case.
The journal
The Activity tab lists every deletion the app made and every change of its settings: time, action, object, result (done, failed, in progress or skipped) and details such as the freed size or the reason. Changes of settings name each changed value, with its old and new values; saving values that are already stored writes no entry. Entries are kept for a year.
The tab offers the journal as a CSV file: every entry the app still holds, newest first, up to 100,000 entries. Times are in UTC, and the file says whether the app or an administrator acted, never whose account it was.
The storage report
The Overview and Spaces tabs show for the site, and the view of a space on the Spaces tab for that space:
- the size of the current versions of files;
- the size of their older versions, measured for the files where it is largest and estimated for the rest;
- the size of the files in the trash;
- the number and size of unused files;
- the size of older versions of files on archived pages, counted apart: it is part of the size of a space and no part of what can be freed.
Pages themselves take almost no storage and are not counted. The Spaces tab offers the report as a CSV file, one line per space, with the sizes in bytes.
A quota is a size set for one space or as a default for every space. A space that reaches 80% of its quota is marked “close to quota”, one that reaches it “over quota”. Nothing is blocked: Confluence offers no way to stop an upload.
The page for space administrators
Space settings → Integrations → Legroom shows the rules that apply to the space, the name of the exemption label, the storage of the space against its quota, and what the older versions of files on its archived pages take. When the Confluence administrator allows it, a space administrator can switch all rules off for the space there and back on. The rules themselves are edited by Confluence administrators only.