How can I delete all duplicate snapshots of a target?

I am trying to get rid of, probably thousands of duplicate snapshots from the cli. In Kopia UI/Web, I can select those snapshots manually, but when running kopia snapshot list --show-identical <source> the output only shows the snapshots like this:


  2023-02-12 02:20:49 CET k7c62fdba086d86a47137b47ecb2022a9 1 TB drwxrwx--- files:409462 dirs:60237 (latest-13,daily-13,weekly-3)
  2023-02-14 02:38:54 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-12,daily-12)
  2023-02-15 02:32:18 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-11,daily-11)
  2023-02-16 02:30:00 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-10,daily-10)
  2023-02-17 02:37:40 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-9,daily-9)
  2023-02-18 02:35:08 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-8,daily-8)
  2023-02-19 02:35:02 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-7,daily-7,weekly-2)
  2023-02-20 02:43:05 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-6,daily-6)
  2023-02-21 02:38:08 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-5,daily-5)
  2023-02-23 02:13:25 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-4,daily-4)
  2023-02-24 02:45:42 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-3,hourly-3,daily-3)
  2023-02-25 02:36:21 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-2,hourly-2,daily-2)
  2023-02-26 02:36:54 CET kb68e459d66907b860ae78610eb1213f1 1 TB drwxrwx--- files:409462 dirs:60237 (latest-1,hourly-1,daily-1,weekly-1,monthly-1,annual-1)

Assume, I want to remove from 2023-02-26, how can I remove this snapshot using kopia snapshot remove <ID> when all the snapshots shown, show the same ID? I don’t feel like having to do this manually via the web IF…

Any ideas, anyone?

Aren’t those <id’s> supposed to be unique…? I checked mine, they are all unique, thanks to “Ignore Identical Snapshots” switch, I guess.

Well, yes - I just figured that out. You will need to address them by their manifest-ids and then you can go from there.

I found this thread while looking for a way to delete identical snapshots using the command line, since I noticed that pinning a snapshot pins all the ones that are identical and wanted to know more about them.

I will leave this here in case someone else is looking for this too.

It seems that using

kopia snapshot delete

does the trick.

Get the snapshot id using

kopia snapshot list <“username:source directory”>

and the manifest id using

kopia snapshot list -m

Make sure that you are passing the manifest ID and not the snapshot ID, or you will delete the whole snapshot.