rockfish prune
Remove old Parquet files based on a retention policy.
Overview
The prune command enforces data retention by removing Parquet files older
than a configurable window. Supports dry-run preview and per-event-type
granularity.
Usage
rockfish prune [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
-d, --data-dir | ./output | Data directory with Parquet files |
--sensor | sensor | Sensor name subdirectory |
--hive | — | Enable hive-style partitioning |
-r, --retention | 30d | Retention period |
--event-types | all | Event types to prune (comma-separated) |
--include-inventory | — | Also prune inventory files |
--dry-run | — | Preview without deleting |
Retention Periods
Supports various time formats:
rockfish prune -r "30d" # 30 days
rockfish prune -r "7d" # 7 days
rockfish prune -r "24h" # 24 hours
rockfish prune -r "30 days" # 30 days (verbose)
Examples
# Preview what would be deleted (dry run)
rockfish prune -d /data/rockfish --sensor prod-01 --hive \
-r "30d" --dry-run
# Delete files older than 7 days
rockfish prune -d /data/rockfish --sensor prod-01 --hive -r "7d"
# Prune only alert and flow data
rockfish prune -d /data --sensor prod-01 \
-r "14d" --event-types alert,flow
# Prune with inventory files
rockfish prune -d /data --sensor prod-01 \
-r "30d" --include-inventory