Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Snapshot deletion makes no sense #362

Closed
Maaartinus opened this issue Dec 31, 2018 · 1 comment
Closed

Snapshot deletion makes no sense #362

Maaartinus opened this issue Dec 31, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@Maaartinus
Copy link

Describe the bug
When I set to keep 5 daily and 5 weekly snapshots, then I want to be able to return to any of the 4 last days when the computer was used. But timeshift deletes all daily backups older than 5 days, so after not using the computer for a few days, there may be no daily backup left (except for the current state). What I described so far is a duplicate of #272, but there's another problem: Once per week two backups are needlessly made, one daily and one weekly backup. That's wasteful as they're pretty much the same. The redundant one mayn't take much space due to hardlinking, but there's still some disk and CPU overhead.

To Reproduce
Steps to reproduce the behavior:

  1. Set up 5 daily and 5 weekly snapshots.
  2. Use the computer for one week.
  3. Observe that there are two backups having the same date.
  4. Don't use the computer for another week.
  5. Switch it on and wait till a daily backup gets made.
  6. Observe that all but the current daily backup are gone.

Expected behavior
The boot snapshots are special and the following does not apply to them. Only run a single snapshot per day, even when both the daily, weekly and monthly snapshots are to be scheduled on the same day.

When there are N daily snapshots set up, make sure that the last N snapshots are kept. Similarly, when there are N weekly snapshots, make sure that there's at least one snapshot kept for each of the last N weeks. When this is not possible (as the snapshot wasn't made or was manually deleted or whatever), keep an older snapshot instead. Similarly for monthly backups.

I guess, my algorithm description is not very clear, but I hope you get what I mean. I can provide an exact algorithm when someone cares.

System:

@teejee2008
Copy link
Owner

teejee2008 commented Jan 2, 2019

Older snapshots are deleted if it is older than N days/weeks (as selected in settings window).

The previous UI showed this correctly but the meaning became less clear when the UI was updated:
image

I have added a fix. Older snapshots will not be deleted if count is less than N.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants