Storage Cleanup
Safely reclaim unreferenced bundle artifacts and shared assets with the storage prune command.
How pruning works
hot-updater storage prune is reference-aware garbage collection. It reads all
bundle records and their manifests, lists the configured storage prefix, and
selects only objects that are no longer referenced.
It can remove:
- Orphaned bundle objects in both the legacy
<bundle-id>/...layout and the currentbundles/<bundle-id>/...layout. - Unreferenced content-addressed assets under
assets/sha256/....
Live bundle objects, referenced assets, recently modified objects, objects without a modification timestamp, and unknown files are protected.
Pruning is not a retention policy. Upgrading Hot Updater fixes new S3 management scans without deleting live bundle records. Delete records you no longer need before pruning their objects.
Select old bundle records
List the records you intend to remove. Narrow the result by channel, platform, or exact target app version as needed:
npx hot-updater bundle list --channel production --platform ios --target-app-version 1.0.0 --limit 100 --jsonDelete one or more selected records:
npx hot-updater bundle delete <bundle-id> <another-bundle-id> --yesbundle delete removes database records. Shared assets and bundle files remain
until a reference-aware prune confirms that no remaining record uses them.
Preview eligible objects
Run an explicit dry run first:
npx hot-updater storage prune --dry-runThe preview shows each eligible object, its modification time, size, type, and the total reclaimable size. The command fails closed if it cannot load all bundle references or required manifests.
The default --protect-newer-than 24h window compares the current time with
each object's storage lastModified timestamp. It does not measure time
since the bundle record was deleted. Increase the window when deployments may
remain in flight for longer:
npx hot-updater storage prune --dry-run --protect-newer-than 7dDurations accept m, h, d, or w, such as 30m, 24h, 7d, or 2w.
Delete eligible objects
Pause every deploy and promote process that writes to the same storage prefix, then run:
npx hot-updater storage prune --protect-newer-than 24h --yesBefore deletion, Hot Updater reloads bundle and manifest references and removes objects from the candidate set if they became live.
The configured database must own every object under the configured storage
prefix. If databases or environments share a bucket, assign each one a
separate storage basePath before pruning.
Storage pruning currently requires the management capabilities provided by
s3Storage, including AWS S3 and S3-compatible services such as Cloudflare R2.