Repository navigation
backup retention: newest per day for 30 days, per month for 12, per year forever - #29
Merged
Merged
Conversation
…ast 30 days, 12 months, and every year (refs #28) keep-newest-N made a 6h schedule a week of history and a daily one a month, nothing older. now the newest backup of each of the last HUSH_BACKUP_KEEP days that have one, of each of the last HUSH_BACKUP_KEEP_MONTHS months that have one (default 12), and of every year is kept; one file can fill several slots. periods are the ones present in the folder, so a gap never shortens what is kept, and the period comes from the filename stamp, not mtime. --keep on the scheduler is days. tests: a stamped fixture across three years, assertions that hold for any run date, the smallest window, unrelated files untouched. version 1.7.0.
…d the version pins move to 1.7.0 (refs #28) ci ran at 15:51Z, so the backup it wrote was the newest file of 2026-11-05 and took that day's slot from the fixture pair. the pair now sits on 11-04. HUSH_VERSION in the cli script moves with package.json and SKILL.md, the maintenance suite pins all three.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refs #28.
backup retention was newest N files. at --keep 30 a 6h schedule is a week of history. nothing older survives.
now tiered: newest per day for 30 days, newest per month for 12 months, newest per year forever. one file can fill several slots. gaps don't shorten anything, periods are whatever is in that folder. period comes from filename stamp not mtime, icloud rewrites mtime. only hush-backup-.gpg files ever get removed, same guard as before.
HUSH_BACKUP_KEEP is still days. HUSH_BACKUP_KEEP_MONTHS is new, default 12. scheduler --keep is days. config unchanged, no reinstall needed.
tests cover 51 stamped files across three years and hold for any run date. 1.7.0 in package.json and SKILL.md.
heads up, two backups same day collapse to newest at next prune. that is what a day slot means but it differs from before.