Skip to Content

Retention

What ClipMux keeps, for how long, and how to prune it by hand.

Every hour, the server deletes what nothing can use any more: old rows in Postgres, and stored files no video plays from. Each window follows from another rule, such as how far back clipmux listen --since reaches, so they are fixed rather than settings. Nothing here deletes a video you haven't deleted.

What's kept, and for how long

WhatKept for
Retired outputs, after a re-encodeThe longer of 7 days and the maximum token lifetime, plus an hour, so a viewer mid-session finishes first
Files of a failed or replaced encoding attempt30 minutes
Stored files under an output that its manifest doesn't listChecked 16 minutes after the output is committed, then deleted
Output folders no record accounts forSwept continuously, 500 videos an hour
This server's disk: staging files and abandoned multipart uploads24 hours and 7 days
Idempotency keys24 hours
Dashboard sessionsUntil they expire, or after 7 days idle
Pairing codes, expired or used24 hours
Webhook deliveries and events, which GET /v1/events and clipmux listen --since read30 days after they finish
Other finished outbox rows7 days
Setup testsThe newest 20
Analytics, hourly, for the 24-hour range14 days
Analytics, daily, and viewer keys180 days. There are no lifetime totals.
Share linksKept, with their state. An expired link's playback ID is revoked within a minute.
Jobs, attempts and dispatchesKept, as history and spend

Route publications, key publications and machine stops are never given up on, because giving up would leave a revocation unpublished or a paid machine running.

On R2 or S3, a multipart upload whose abort failed is left to a lifecycle rule on the bucket. Connecting a bucket doesn't set one; add it at your provider.

Prune by hand

clipmux admin prune runs the same deletion now and prints what went.

cd /opt/clipmux
docker compose exec app clipmux admin prune --dry-run
FlagWhat it does
--dry-runCounts what would go, inside a transaction it rolls back, so the counts are exact and nothing changes.
--filesAlso deletes stored files past their windows: retired outputs, replaced attempts' files, orphaned output folders, and this server's disk's leftovers.

clipmux admin outbox lists route publications, wakes and stops still pending after an hour. clipmux admin outbox --retry ID makes one due at once.

Check it works

clipmux admin prune --dry-run counts what the next hourly pass would delete. On a server that has run for a while, the counts stay small. If they keep growing, the passes are failing: the retention and file_retention loops report errors in the log and in clipmux_sweeper_errors_total (see Monitoring).

Next

On this page