I have accidentally backed up some large folders in my repository, that I have no need to back up, and don’t exist anymore. Is there a way to delete whole folders from all snapshots? I am trying snapshot fix remove-files
but it seems to only work on the basis of file names, and doesn’t seem to work with something like /path/to/folder/to/delete
or /path/to/folder/to/delete/*
If the files/folders don’t exist anymore, I think you can delete the historical snapshots that have those files/folders, and just keep the snapshots you want.
Just make sure the snapshots that you are deleting don’t have files that you do need, if you were to need to recover those files from those specific snapshots.
Or just wait until the snapshots expire (or adjust retention period).
Is there any way to get support on how to remove a backed up folder from all snapshots?
I don’t want to delete snapshots that contain the folder because then I lose a lot more than just the folder.
Maybe it’s a bug/ not implemented. Maybe I just need support on how to do it.
opened 06:43PM - 16 Sep 23 UTC
Hello,
I have a Kopia repository that periodically runs a snapshot of a volum… e located at `/srv/`.
I backed up a kopia repository created by a different computer located at `/srv/users/<REDACTED>/kopia-repo` that I am trying to remove from the snapshots. I've tried multiple ways to remove it with the `snapshot fix remove-files --filename` command but all attempts have been unsuccessful.
Steps to reproduce:
1. Check output of `kopia snapshots list "/srv/users/<REDACTED>/kopia-repo/"`
```txt
kopia snapshot list "/srv/users/<REDACTED>/kopia-repo/"
root@<REDACTED-HOST>:/srv
2023-09-16 09:38:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 10:23:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:08:26 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:17:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:28:53 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:37:22 EDT <ERROR> error reading directory: entry not found
2022-04-30 23:00:52 EDT k055f5ef6d2ffa90d5b7162cfb8e21485 263.5 GB drwxrwxr-x files:11583 dirs:19036 (monthly-17)
2022-05-31 23:00:58 EDT k9ef9aa13f22bbd16ac7c4b24abae95e6 272.5 GB drwxrwxr-x files:11987 dirs:19837 (monthly-16)
2022-06-30 23:01:13 EDT kf9f26e185cdb62826019dd1234d604bf 277.3 GB drwxrwxr-x files:12209 dirs:20503 (monthly-15)
2022-07-31 23:01:11 EDT kde35f3a11f238483c9ee93c11284d83e 277.2 GB drwxrwxr-x files:12227 dirs:20900 (monthly-14)
2022-08-31 23:00:35 EDT k0e25bc8a84dcd6d312876257e96ac724 281.6 GB drwxrwxr-x files:12403 dirs:21295 (monthly-13)
2022-09-30 23:00:49 EDT k21f9ac336008d0a542f225401b22e631 281.1 GB drwxrwxr-x files:12381 dirs:21539 (monthly-12)
```
2. run remove-files with multiple wildcards all of which are unsuccessful
```txt
kopia snapshot fix remove-files --filename="users/<REDACTED>/kopia-repo*" --commit
kopia snapshot fix remove-files --filename="users/<REDACTED>/kopia-repo/*/*/*" --commit
kopia snapshot fix remove-files --filename="**/users/<REDACTED>/kopia-repo/**" --commit
kopia snapshot fix remove-files --filename="users/<REDACTED>/kopia-repo/pc2/62a/732d714adcb996c90b115b82a89-s4dc8e31b1d0d584b117.f"
kopia snapshot fix remove-files --filename="users/<REDACTED>/kopia-repo/pc2/62a/732d714adcb996c90b115b82a89-s4dc8e31b1d0d584b117.f" --commit
kopia snapshot fix remove-files --filename="/srv/users/<REDACTED>/kopia-repo/" --commit
kopia snapshot fix remove-files --filename="/users/<REDACTED>/kopia-repo/" --commit
kopia snapshot fix remove-files --filename="/srv/users/<REDACTED>/kopia-repo/*" --commit
kopia snapshot fix remove-files --filename="users/<REDACTED>/kopia-repo/*" --commit
kopia snapshot fix remove-files --filename="**/<REDACTED>/kopia-repo/*" --commit
kopia snapshot fix remove-files --filename="**/<REDACTED>/kopia-repo/*"
```
Note: There are multiple WARNINGS that I am not sure if they are relevant or not `unable to create memory-mapped segment: unable to create memory-mapped file: open : no such file or directory`
3. After the run, run list again and see that the snapshots are still listed
```txt
kopia snapshot list "/srv/users/<REDACTED>/kopia-repo/"
root@<REDACTED-HOST>:/srv
2023-09-16 09:38:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 10:23:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:08:26 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:17:21 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:28:53 EDT <ERROR> error reading directory: entry not found
2023-09-16 11:37:22 EDT <ERROR> error reading directory: entry not found
2022-04-30 23:00:52 EDT k055f5ef6d2ffa90d5b7162cfb8e21485 263.5 GB drwxrwxr-x files:11583 dirs:19036 (monthly-17)
2022-05-31 23:00:58 EDT k9ef9aa13f22bbd16ac7c4b24abae95e6 272.5 GB drwxrwxr-x files:11987 dirs:19837 (monthly-16)
2022-06-30 23:01:13 EDT kf9f26e185cdb62826019dd1234d604bf 277.3 GB drwxrwxr-x files:12209 dirs:20503 (monthly-15)
2022-07-31 23:01:11 EDT kde35f3a11f238483c9ee93c11284d83e 277.2 GB drwxrwxr-x files:12227 dirs:20900 (monthly-14)
2022-08-31 23:00:35 EDT k0e25bc8a84dcd6d312876257e96ac724 281.6 GB drwxrwxr-x files:12403 dirs:21295 (monthly-13)
2022-09-30 23:00:49 EDT k21f9ac336008d0a542f225401b22e631 281.1 GB drwxrwxr-x files:12381 dirs:21539 (monthly-12)
```
Version: 0.13.0 build: 7f69502bddd6650e7cb7a132291bc54920e58988 from: kopia/kopia