| Crates.io | prune-backup |
| lib.rs | prune-backup |
| version | 0.1.0 |
| created_at | 2026-01-24 00:52:34.768218+00 |
| updated_at | 2026-01-24 00:52:34.768218+00 |
| description | Prune backup files based on retention policies, keeping recent files and moving old ones to trash |
| homepage | |
| repository | https://github.com/junzh0u/prune-backup |
| max_upload_size | |
| id | 2065840 |
| size | 67,369 |
A CLI tool for managing backup file rotation. Scans a directory and applies retention policies based on file creation dates, moving old files to a .trash subdirectory.
cargo install --path .
prune-backup <DIRECTORY> [OPTIONS]
| Option | Default | Description |
|---|---|---|
--keep-last <N> |
5 | Keep the last N backups |
--keep-hourly <N> |
24 | Keep one backup per hour for the last N hours |
--keep-daily <N> |
7 | Keep one backup per day for the last N days |
--keep-weekly <N> |
4 | Keep one backup per week for the last N weeks (ISO week system) |
--keep-monthly <N> |
12 | Keep one backup per month for the last N months |
--keep-yearly <N> |
10 | Keep one backup per year for the last N years |
--dry-run |
- | Show what would be moved without actually moving files |
# Use default retention policies
prune-backup /path/to/backups
# Keep only the last 10 backups and 30 days of daily backups
prune-backup /path/to/backups --keep-last 10 --keep-daily 30
# Preview what would be deleted
prune-backup /path/to/backups --dry-run
.trash/ subdirectoryFiles are never permanently deleted—they're moved to .trash for manual review.
MIT