Screenshots, time intervals, and storage retention in Cattr #363
Cattr Admin
announced in
Guides & How-tos
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This guide explains how screenshot capture is controlled, how screenshots are associated with time intervals, what happens when intervals are deleted, and how Cattr automatically reclaims screenshot storage.
Screenshot policy levels
Cattr can control screenshot capture at several levels:
The available screenshot states are:
Instance-wide override
The server supports:
ANYis the default.Setting the environment value to:
forces screenshots on globally.
Setting it to:
forces screenshots off globally.
A forced instance-level
REQUIREDorFORBIDDENstate overrides the company, project, and user settings.Company screenshot policy
Administrators can configure the company screenshot policy in the company settings.
The company-level choices are:
If the company policy is Required or Forbidden, project and user screenshot controls are locked to that policy.
If the company policy is Optional, projects and users may define more specific behavior.
Project screenshot policy
Each project has its own screenshot state.
When the company policy is Optional, a project can be configured as:
The project policy has priority over the individual user setting.
In practical terms:
User screenshot policy
When the company and project policies allow it, a user's screenshot setting determines whether screenshots are captured for projects configured as Optional.
The user-level setting effectively allows screenshots to be either required or forbidden for that user.
For example:
→ screenshots are stored.
→ screenshots are not stored.
But:
→ screenshots are still stored because the project requires them.
Screenshot interval
Each user has a
screenshots_intervalsetting.The server currently accepts values from 1 to 15 minutes.
This value controls the interval used by the client when screenshot capture is enabled for that user/project combination.
How screenshots are stored
A screenshot belongs to a time interval.
When an interval containing a screenshot is accepted by the server, Cattr checks the effective project/user screenshot policy before saving the image.
Screenshots are stored as JPEG files.
Cattr also creates a thumbnail for each screenshot.
Inside the configured Cattr storage disk, screenshot files are kept under:
and thumbnails under:
The current screenshot service stores JPEG images at quality 50 and generates thumbnails with a width of 280 pixels.
Deleting a time interval
Time intervals use soft deletion in the database.
Deleting an interval sets its deletion state rather than immediately removing the database row.
However, the screenshot files associated with that interval are deleted when the interval is deleted.
Both the full screenshot and its thumbnail are removed.
This means:
Current permission rules allow an administrator to remove intervals generally, while normal users and other roles may remove intervals that belong to themselves according to the applicable access policy.
Bulk interval removal is also supported for users with the corresponding permission.
Because screenshot removal is tied to interval deletion, deleting intervals should not be used merely as a storage-cleanup mechanism.
Screenshot thinning
Cattr has a separate screenshot storage cleanup mechanism called thinning.
Thinning removes screenshot files while leaving the corresponding time intervals in the database.
After thinning:
This is fundamentally different from deleting the interval itself.
When thinning starts
Cattr calculates screenshot-storage usage against a configured storage size.
The relevant environment variables are:
SCREENSHOTS_STORAGE_SIZE_BYTESdefaults to the total size of the filesystem containing the configured screenshot storage.The default thinning threshold is 75% used.
If usage is below the threshold, the screenshot rotation command does nothing.
With the default settings, once thinning begins, Cattr continues removing eligible screenshots until usage falls below the calculated waterline.
The target is calculated as:
With the defaults:
So thinning begins at 75% usage and attempts to reduce eligible screenshot storage until total usage is approximately 63.75% or lower.
Automatic thinning
Administrators can enable Auto thinning in the company settings.
When enabled, Cattr schedules the screenshot rotation command weekly.
The command is:
The scheduled command still checks the configured storage threshold. Enabling auto thinning does not mean screenshots are deleted every week regardless of storage usage.
Manual thinning
The About page contains storage information including:
The storage section also provides a thinning action.
Starting cleanup from the UI queues the same screenshot rotation process.
If storage usage has not reached the configured threshold, the rotation command will not remove screenshots.
The command can also be run manually:
Which screenshots can be removed by thinning
The storage cleaner does not treat every screenshot as removable.
A screenshot is eligible for thinning only when all of the following are true:
permanent_screenshotsenabled;Eligible screenshots are processed starting from the oldest interval IDs.
This allows important projects/tasks to protect their screenshots from normal storage thinning.
Protecting screenshots from thinning
If screenshots for a project or task must be retained, mark the relevant project/task as important.
The cleaner explicitly excludes screenshots associated with important tasks or important projects.
There is also a legacy/internal per-user
permanent_screenshotsflag which the cleaner respects, although it is not currently exposed as a normal editable field in the user settings UI.Do not rely on filesystem permissions or manually moving screenshot files as a retention strategy.
Monitoring storage
The storage information endpoint is:
It reports:
This information is also displayed in the web interface.
“Screenshots available for thinning” is zero
If Cattr reports that storage is heavily used but
screenshots_availableis zero, check whether the remaining screenshots are protected.Common reasons include:
Thinning stops when there are no eligible screenshot files left, even if the configured target usage has not been reached.
Deleting screenshots vs deleting intervals
Use the appropriate operation for the intended result:
Storage sizing recommendations
Screenshot storage can grow quickly on installations with many active users.
When planning storage:
/api/about/storageor the corresponding UI;The thinning mechanism is a capacity-management feature, not a backup system.
Before changing retention settings
Before enabling aggressive thinning or reducing available storage:
Deleted screenshot files are not restored from the associated time interval.
Troubleshooting
If screenshots are not being captured:
SCREENSHOTS_STATE;If screenshots disappear unexpectedly:
When asking for help, include:
Do not post private employee screenshots or unredacted activity data in a public Discussion.
All reactions