Skip to main content

mr resources versions-cleanup

Bulk-clean old Resource versions across the entire corpus. Applies the same retention rules as the singular resource versions-cleanup: --keep N retains the N most recent versions per resource; --older-than-days N removes versions older than N days. Both filters may be combined. Scope the operation to a single owner group with --owner-id. Pass --dry-run to preview the count of versions that would be removed without committing any deletes.

Usage

mr resources versions-cleanup

Examples

Keep last 3 versions across all resources

mr resources versions-cleanup --keep 3

Preview cleanup of versions older than 90 days

mr resources versions-cleanup --older-than-days 90 --owner-id 5 --dry-run

Remove all but the latest version across the entire corpus

mr resources versions-cleanup --keep 1

Flags

FlagTypeDefaultDescription
--keepuint0Number of versions to keep
--older-than-daysuint0Delete versions older than N days
--owner-iduint0Filter by owner group ID
--dry-runboolfalsePreview without deleting

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Exit Codes

0 on success; 1 on any error

See Also