BTRFS-BACKUP-NG-PRUNE(1)
π btrfs-backup-ng-prune β apply retention policies β¨
okay bestie, this is the manual page for btrfs-backup-ng-prune, one of the btrfs-backup-ng girlies. she's the one who does the cleanup. you're gonna love her, fr fr. π§Ήπ
πΈ SYNOPSIS πΈ
btrfs-backup-ng prune [OPTIONS]
π DESCRIPTION π
So. btrfs-backup-ng prune applies retention policies to clean up your old snapshots and backups. she goes through every snapshot one by one, checks it against the retention rules you configured, and yeets the ones that exceed the limits. iconic behavior, no notes. β¨
π¦ snapper girlies, listen up: a volume whose source is snapper gets pruned on its destinations only, under each target's own retention policy. the decision and the deletion run are the same ones that happen after a transfer. the numbered slots below .snapshots on the destination? those are the backups, and they're dated from their info.xml. the source, meanwhile, is snapper's own timeline β snapper's cleanup algorithms run that. this command never deletes a snapper snapshot on the source. not ever. periodt. π
Retention gets evaluated with these rules:
minβ absolute minimum retention. nothing gets deleted before this age. nothing. she's patient. π«Ά- the time buckets (
hourly,daily,weekly,monthly,yearly) get evaluated newest-to-oldest. π₯ - the oldest snapshot in each time bucket is kept β that's the first-of-interval representative, matching the
btrbk/snapperconvention. yes ma'am. π - the latest snapshot is always preserved. always always. the main character. π
- for raw (stream-file) targets, a parent stream that a kept incremental backup still needs is never deleted β deleting it would make the newer backup unrestorable π. for btrfs targets, a pruned parent just means the next backup has to be a full send. no biggie, just slower. π
β¨ Note on durations, bestie, this one matters:minvalues in months or years (1M,1y) are calendar-aware in this version β1Mis one calendar month (aligned with the monthly bucket), not a flat 30 days. weekly buckets use ISOβ8601 week numbering, so a week that straddles a year boundary is counted once. aminofallkeeps every snapshot in that scope and prunes nothing there. and an invalidminvalue now fails loudly (the volume gets skipped) instead of silently defaulting. she learned boundaries. π
π¨ SAFETY π¨
On an interactive terminal, a real (nonβ--dry-run) prune prints the full deletion plan and prompts you for confirmation before deleting anything. if you decline, it aborts with no deletions. no harm no foul. π«Ά
In a nonβinteractive context (cron, a pipe) the prompt gets skipped and prune just proceeds β so use --yes if you want to skip the prompt in an interactive terminal too.
A degenerate policy that would keep only the latest snapshot (all time buckets 0 and min β€ 1 day) is refused, deleting nothing, unless you pass --force β and this is enforced even nonβinteractively, so a misconfiguration cannot silently wipe your history. ππ
A shortβwindow policy with a real min (say, 30d with zero buckets) is not degenerate. she knows the difference. she's smart like that. π§ β¨
π OPTIONS π
--dry-runβ show what would be deleted without making any changes, snapper destination slots included. highly recommended before running prune for the first time. like, pls do this first bestie π--yes,-yβ skip the interactive confirmation prompt (for automation). π€--forceβ prune even under a degenerate policy that would keep only the latest snapshot. use with intention. π₯
π EXAMPLES π
Show what would be pruned (dry run):
btrfs-backup-ng prune --dry-run
Apply retention policies (prompts on an interactive terminal):
btrfs-backup-ng prune
Nonβinteractive / automation (skip the prompt):
btrfs-backup-ng prune --yes
Intentionally prune under a keepβonlyβlatest policy:
btrfs-backup-ng prune --force
π RETENTION CONFIGURATION π
Example retention settings in config.toml:
[global.retention]
min = "1d" # Keep everything for at least 1 day
hourly = 24 # Then keep 24 hourly snapshots
daily = 7 # Then keep 7 daily snapshots
weekly = 4 # Then keep 4 weekly snapshots
monthly = 12 # Then keep 12 monthly snapshots
yearly = 0 # Don't keep yearly (0 = disabled)
π SEE ALSO π
btrfs-backup-ng(1), btrfs-backup-ng-run(1)
anyway that's the whole page bestie, go forth and prune responsibly π this was btrfs-backup-ng, July 2026, signing off. slay, stay safe, and always --dry-run first πβ¨π¦πΈ
π¦ where this page comes from
- fedora 43: btrfs-backup-ng 0.9.20-2.fc43 Β· MIT
- fedora 44: btrfs-backup-ng 0.9.20-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms