Thanks for the super-quick response, rawtaz!
Answer to your question
No change to how I run the backups that I recall. I set it up months ago and it’s just been humming along. But I suppose I can’t say 100% for sure.
It’s not in any other snapshots
I believe I have tried what you suggested. I looked in a snapshot from a week ago, and the file isn’t there. I have also tried the thing of doing a restic mount and then (within the mounted path) doing ls [mountpoint]/snapshots/*/path_to_file. The only instance that is found is the one from earlier today.
I began to fear the following scenario, but it seems to me that it wouldn’t make any sense for it to work this way:
- The previous version of the file (actually a whole folder) was backed up in a snapshot made just after it was created.
- The file has never changed since.
- The snapshot was forgotten and pruned according to the forget-and-prune schedule
- The file only appeared in the snapshot in which it was first created, so now it’s gone forever.
But that scenario doesn’t make sense to me - if it worked that way, nobody would ever want the forget/prune feature.
More detail
Here’s a look into the folder in question, inside the “latest” snapshot in the mount:
drwx–x–x 2 root root 0 Sep 2 09:41 ./
drwxr-xr-x 2 root root 0 Mar 29 16:44 …/
drwx–x–x 2 root root 0 Mar 27 22:28 buildkit/
drwx-----x 2 root root 0 Sep 2 09:48 containers/
drwx------ 2 root root 0 Mar 27 22:28 image/
drwxr-x— 2 root root 0 Mar 27 22:28 network/
drwx-----x 2 root root 0 Sep 2 09:48 overlay2/
drwx------ 2 root root 0 Mar 27 22:28 plugins/
drwx------ 2 root root 0 Sep 2 09:41 runtimes/
drwx------ 2 root root 0 Mar 27 22:28 swarm/
drwx------ 2 root root 0 Sep 2 09:48 tmp/
drwx------ 2 root root 0 Mar 27 22:28 trust/
drwx-----x 2 root root 0 Sep 2 09:48 volumes/
You can see that this stuff was all originally created on March 27, while the overwrites occurred today. And the thing I need is “nextcloud_db_data” within volumes:
root@stanley:/mnt/repo/snapshots/latest/var/lib/docker/volumes# ll
total 33
drwx-----x 2 root root 0 Sep 2 09:48 ./
drwx–x–x 2 root root 0 Sep 2 09:41 …/
brw------- 1 root root 0, 0 Sep 2 09:41 backingFsBlockDev
drwx-----x 2 root root 0 Sep 2 09:48 c59f2d58c3a0d647c03d71844135eb0c977c30d0023f239de8b4563adb8879ed/
drwx-----x 2 root root 0 Sep 2 09:48 ed40321be6b07fffccedea413d4ada604f222d09bf6b1c0f20ea9028566bf7e4/
drwx-----x 2 root root 0 Sep 2 09:48 f20bb0a6a0eb6583073ee432cd1c1340a7470f2cba21badd18951adf10c20f43/
-rw------- 1 root root 32768 Sep 2 09:48 metadata.db
drwx-----x 2 root root 0 Sep 2 09:46 nextcloud_db_data/
And you can see here that I have a snapshot from March 31, so you’d think it would be in there:
root@stanley:/mnt/repo/snapshots# ls
2021-02-28T18:00:15-08:00 2021-08-28T18:00:15-07:00 2021-09-01T06:00:15-07:00
2021-03-31T18:00:15-07:00 2021-08-29T18:00:15-07:00 2021-09-01T12:00:15-07:00
2021-04-30T18:00:16-07:00 2021-08-30T12:00:15-07:00 2021-09-01T18:00:15-07:00
2021-05-31T18:00:15-07:00 2021-08-30T18:00:15-07:00 2021-09-02T00:00:15-07:00
2021-06-30T18:00:15-07:00 2021-08-31T00:00:15-07:00 2021-09-02T06:00:15-07:00
2021-07-31T18:00:15-07:00 2021-08-31T06:00:15-07:00 2021-09-02T12:00:16-07:00
2021-08-15T18:00:16-07:00 2021-08-31T12:00:16-07:00 latest
2021-08-22T18:00:15-07:00 2021-08-31T18:00:15-07:00
2021-08-27T18:00:15-07:00 2021-09-01T00:00:15-07:00
But it simply isn’t there. The “volumes” folder is there, but inside it there is no folder “nextcloud_db_data”.
root@stanley:/mnt/repo/snapshots/2021-03-31T18:00:15-07:00/var/lib/docker/volumes# ll
total 33
drwx-----x 2 root root 0 Mar 29 23:34 ./
drwx–x–x 2 root root 0 Mar 29 23:34 …/
brw------- 1 root root 0, 0 Mar 29 23:34 backingFsBlockDev
-rw------- 1 root root 32768 Mar 29 23:34 metadata.db
So then my aforementioned fear sets in. What if it was in a snapshot from 3/27/2021 which then got blown away?
When snapshots are forgotten and pruned, is the process sophisticated enough to move unique content from the pruned snapshots forward to a later snapshot?
If it isn’t that sophisticated, am I using the tool incorrectly, and/or trying to ask it to do something it isn’t intended to do?
If you say no, my understanding is correct and it should work the way I think, then I’ll just chalk it up to my having shot myself in the foot at some point doing something that I don’t recall. I suppose that in the early days I could have done something naive like manually deleting a snapshot from the repo rather than using restic to do it, although I don’t know why I would have done that.
Of course, if you think my data might still be in there somewhere, that would be best of all, but I’m beginning to lose hope for that.
Thanks,
Brad