This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build the binary
go build -o medusa-retention-refresher .
# Run directly
go run main.go -bucket <bucket> -cluster <cluster> -min-retention <days> -max-retention <days> [-dry-run]
# Manage dependencies
go mod tidyA CLI utility that refreshes S3 Object Lock retention periods for Cassandra backups created by Medusa. It:
- Scans an S3 bucket for Medusa backup manifests (
[cluster]/[hostname]/[backup_name]/meta/manifest.json) - Parses each manifest to get the list of backup objects
- Checks each object's current retention period
- Extends retention to max-retention days if the current retention expires before min-retention days from now
Backup structure:
- Manifests:
[cluster]/[hostname]/[backup_name]/meta/manifest.json - Data files:
[cluster]/[hostname]/data/...(shared across all backups)
Uses S3 Object Lock in GOVERNANCE mode.
-bucket: S3 bucket name containing backups-cluster: Cassandra cluster name (used as the S3 prefix)-min-retention: Minimum retention threshold in days - objects expiring before this will be updated-max-retention: Target retention in days - new retention period when updating objects-dry-run: Optional flag to preview changes without applying them