I’m pretty certain I have a good grasp on how restic works its magic, but I just want to make really sure for one point in particular.
Let’s say you have 10 backups of one certain directory (only containing files), 1 for every day, so 10 days worth of backups. Now let’s say that on the 4th day (before the backup runs) I add a new file to the directory and keep it at least until the 10th backup. Let’s also say (for the sake of clarity) that the contents of the files don’t change at all. Then I decide to delete the 4th snapshot. Now what I think happens:
- Restic checks what files** were only in that backup and delete those.
- This means that the blobs added before the 4th backup have now “physically moved” into the 5th snapshot and are referenced by backups 6 thru 10 (because of deduplication, this data is not actually present in subsequent backups). I do understand that even snapshot 5 simply refers to an index for this data, but it would still be the “origin” snapshot of the file.
- When I restore the 5th snapshot, this new file should also/still be there.
Is this (largely) correct or doesn’t restic work like that at all? I’d like to see a technical explanation of what exactly is going on when restic deletes snapshots.