How to Bulk Delete Images Based on Name Pattern in Immich? #14674
-
I’m in a bit of a bind and could use some guidance on cleaning up my Immich server. I need to delete approximately 500,000 images from my Immich server that follow the naming pattern Backstory
IssueI would like to delete all I understand that I could theoretically run something like this, find /path/to/root -type f -name '*-thumbnail.webp' -delete However, I suspect this wouldn’t clean the Immich database properly, and I'm not sure if there would be a bunch of thumbnails of thumbnails wasting space on my server. QuestionIs there a recommended or safe way to bulk delete these files and also update the Immich database? The latter would be time-consuming as my library is nearly 5TB in size and would take many days to re-upload, so I’m hoping there’s a more efficient solution. Any advice or guidance would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
From the advanced search menu, you can filter by (part of) filename: Then you could try just select-all and delete, though for half a million assets the UI might not be all too happy about that. A better chance would be to write a little script using that search query against the API directly. |
Beta Was this translation helpful? Give feedback.
-
I will note that I experienced something like this while all of these thumbnails were uploaded on the same day: #13319 |
Beta Was this translation helpful? Give feedback.
From the advanced search menu, you can filter by (part of) filename:
Then you could try just select-all and delete, though for half a million assets the UI might not be all too happy about that. A better chance would be to write a little script using that search query against the API directly.