Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --keep-hourly-within switch to restic forget #3414

Closed
torfason opened this issue Jun 4, 2021 · 0 comments · Fixed by #3416
Closed

Add --keep-hourly-within switch to restic forget #3414

torfason opened this issue Jun 4, 2021 · 0 comments · Fixed by #3416

Comments

@torfason
Copy link
Contributor

torfason commented Jun 4, 2021

Output of restic version

restic 0.12.0 compiled with go1.15.7 on darwin/amd64

What should restic do differently? Which functionality do you think we should add?

New switches would be added to the restic forget command, including --keep-hourly-within, and similar for daily/weekly/monthly/yearly allowing an interval to be specified for how long such backups should be kept, instead of specifying the number of each type of backup.

What are you trying to do? What problem would this solve?

As mentioned on a forum thread, if backups are irregular, hourly backups specified with --keep-hourly=30 sometimes span a bit over a day, but sometimes they span a lot more than that. For systems with irregular backup schedules (and perhaps for all systems), the more natural approach would be to allow specifying hourly snapshots younger than a specific age (relative to the newest snapshot).

The relationship between the current --keep-hourly and a new --keep-hourly-within would be the same as the relationship between --keep-last and --keep-within. One keeps last n snapshots of a given type, the other keeps any snapshots within a given time period (relative to the latest snapshot) of a given type.

Putting this in a table, we would have the following (with italic denoting the new parameters):

Type Keep last n snapshots of a given type Keep snapshots within a given time period of a given type
any --keep-last --keep-within
hourly --keep-hourly --keep-hourly-within
daily --keep-daily --keep-daily-within
weekly --keep-weekly --keep-weekly-within
monthly --keep-monthly --keep-monthly-within
yearly --keep-yearly --keep-yearly-within

Did restic help you today? Did it make you happy in any way?

Yes, the cheap snapshots that let me got rid of annoying incremental backups are a dream. And the code base is super easy to work with :-)

@torfason torfason changed the title Add --keep-hourly-within=1w2d3h (and daily, etc.) switches to restic forget Add --keep-hourly-within switch to restic forget Jun 4, 2021
@torfason torfason mentioned this issue Jun 4, 2021
8 tasks
@fd0 fd0 closed this as completed in #3416 Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant