So snapshots are incremental, meaning each snapshot only stores the changes made since the previous one.
What if I delete with restic prune
the very first snapshot?
So snapshots are incremental, meaning each snapshot only stores the changes made since the previous one.
What if I delete with restic prune
the very first snapshot?
No, this is not correct. Pardon any incorrect terminology, but you can think of it like this:
That snapshot will be deleted and data which is pointed to ONLY by that snapshot will be deleted.
All other snapshots and all data they point to are unaffected.
so if I have files A, B, C in very first snapshot, then delete file C and make a new snapshot.
The first snapshot still could restore A, B, C
The second snapshot could restore A, B
Correct?
And to summarize it’s OK to delete any snapshot including the first one with no side affects?
Yes, correct!
… additionally if you don’t run the restic prune
command none of the data that is actually stored in the repository is deleted. The restic forget
command is to just make the repository, well, forget about that snapshot and has nothing to do with the actual deletion of backed up data.
See Removing backup snapshots — restic 0.17.3 documentation
Thanks for joining
I was interesting with prune
option.
Is it a reason just to use forget
without prune?
There can be many reasons to do that. This is explained in the link I shared earlier from the documentation.
Out of curiosity, was this documentation confusing or not helpful to get an understanding? If so then we could possible update it to make it more clear for other users. Let us know!
There is also a post here (which basically says the same) Prune vs Forget? - #8 by fd0
Think of it this way:
forget
: You tell restic to move snapshots to the trash can (the snapshots are no longer listed, but they still occupy space in your repository).prune
: You tell restic to empty the trash can (the snapshots you previously forget
are now removed completely, and no longer take up any space in the repository).“trash can” is a somewhat ambiguous term here. A snapshot is essentially a reference to the actual backed up data. forget
just permanently deletes this reference. (the recover
command is still able to find the data though, but it won’t be able to recreate the exact snapshot).
I was trying to explain it with as simple of a analogy as I could think of, and one that pretty much every computer user would be familiar with, and leaving out technical details to avoid any mental overhead or confusion. Is there a better analogy?
Good question, I don’t have a really fitting analogy here. When reading “trash can” the standard “recycle bin” of a computer came into my mind. And this is where the analogy breaks as standard “recycle bins” allow you to restore files. But forget
doesn’t allow that.