is it possible to remove only non-existing from ./cache/thumbnails?
Hello, my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing". I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that. Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore? Didn't find anything useful in big brother... Do you know a smart solution? have a nice day! Daniel -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com
On Mon, Apr 18, 2022 at 2:47 PM Daniel Bauer
Hello,
my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing".
I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that.
Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore?
Didn't find anything useful in big brother...
Do you know a smart solution?
On a very casual look thumbnails (PNG files) contain property with original filename so you should be able to script this using any tool for querying PNG properties. tux@localhost:~> identify -verbose .cache/thumbnails/large/3f44c69467eb287ea609416cb96a7ca3.png Image: Filename: .cache/thumbnails/large/3f44c69467eb287ea609416cb96a7ca3.png Format: PNG (Portable Network Graphics) ... Properties: ... Software: GNOME::ThumbnailFactory Thumb::MTime: 1647638907 Thumb::URI: file:///usr/share/icons/gnome-logo-text.svg
Am 18.04.22 um 14:32 schrieb Andrei Borzenkov:
On Mon, Apr 18, 2022 at 2:47 PM Daniel Bauer
wrote: Hello,
my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing".
I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that.
Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore?
Didn't find anything useful in big brother...
Do you know a smart solution?
On a very casual look thumbnails (PNG files) contain property with original filename so you should be able to script this using any tool for querying PNG properties.
tux@localhost:~> identify -verbose .cache/thumbnails/large/3f44c69467eb287ea609416cb96a7ca3.png
Image: Filename: .cache/thumbnails/large/3f44c69467eb287ea609416cb96a7ca3.png Format: PNG (Portable Network Graphics) ... Properties: ... Software: GNOME::ThumbnailFactory Thumb::MTime: 1647638907 Thumb::URI: file:///usr/share/icons/gnome-logo-text.svg
Thank you for the hint, Andrei! I tried some and found that not all have the "Thumb::URI:" entry... Anyway: I have 15 GB of thumbnails and I just tried what will happen i I removed them, so I renamed the folders and rebooted (I had to reboot anyway, logging out and in would probably have been enough). I found that the creation of the missing thumbs is so very fast on that new computer, even in large directories with large image files, that I'll just delete the old thumbnails directories and forget about a selective clean-up... -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com
Am 18.04.22 um 20:07 schrieb Daniel Bauer: ...
my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing".
I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that.
Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore?
...
What about the little bash script below, which executes on my computer when logging out from KDE, not only for thumbnails but also for "RecentDocuments" and "docdata"? (Leap 15.3/KDE-Plasma) cu Peter ----------------------- Thumbnails sometimes contain confidential date, therefore bigger ones are always removed, smaller ones after 30 days. #!/bin/bash find ~/.cache/thumbnails/ -type f -size -50k -print -exec rm '{}' \; find ~/.cache/thumbnails/ -type f -mtime +30 -print -exec rm '{}' \; # find ~/.thumbnails/ -mindepth 1 -type f -size -50k -print -exec rm '{}' \; find ~/.thumbnails/ -mindepth 1 -type f -mtime +30 -print -exec rm '{}' \; # find ~/.local/share/RecentDocuments/ -type f -print -exec rm '{}' \; find ~/.local/share/okular/docdata/ -type f -print -exec rm '{}' \; #
On 2022-04-19 11:36, Peter McD wrote:
Am 18.04.22 um 20:07 schrieb Daniel Bauer: ...
my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing".
I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that.
Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore?
...
What about the little bash script below, which executes on my computer when logging out from KDE, not only for thumbnails but also for "RecentDocuments" and "docdata"? (Leap 15.3/KDE-Plasma)
Interesting.
Thumbnails sometimes contain confidential date, therefore bigger ones are always removed, smaller ones after 30 days.
#!/bin/bash find ~/.cache/thumbnails/ -type f -size -50k -print -exec rm '{}' \; find ~/.cache/thumbnails/ -type f -mtime +30 -print -exec rm '{}' \;
I have ~2 GB here.
# find ~/.thumbnails/ -mindepth 1 -type f -size -50k -print -exec rm '{}' \; find ~/.thumbnails/ -mindepth 1 -type f -mtime +30 -print -exec rm '{}' \;
I have ~180 MB here.
# find ~/.local/share/RecentDocuments/ -type f -print -exec rm '{}' \; find ~/.local/share/okular/docdata/ -type f -print -exec rm '{}' \; #
This one I want, they are only .desktop files, small. I wonder if there isn't already a tool to purge old "temporary" files like cache or thumbnails. If it doesn't exist, it should. My entire .cache directory has 12 GB. Biggest ones in mozilla, thumbnails and thunderbird. But I do not see old files in a quick check. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Am 19.04.22 um 15:12 schrieb Carlos E. R.:
On 2022-04-19 11:36, Peter McD wrote:
Am 18.04.22 um 20:07 schrieb Daniel Bauer: ...
my ~/.cache/thumbnails contains uncountable old files for images that do not exist anymore, so they are there "for nothing". I know I can delete those folders and they will be rebuilt, but rebuilding will take some time, so I don't want that. Is there a way to clean-up those directories, only delete the thumbnails for files that do not exist anymore? ...
What about the little bash script below, which executes on my computer when logging out from KDE, not only for thumbnails but also for "RecentDocuments" and "docdata"? (Leap 15.3/KDE-Plasma)
Interesting.
Thumbnails sometimes contain confidential date, therefore bigger ones are always removed, smaller ones after 30 days.
#!/bin/bash find ~/.cache/thumbnails/ -type f -size -50k -print -exec rm '{}' \; find ~/.cache/thumbnails/ -type f -mtime +30 -print -exec rm '{}' \;
I have ~2 GB here.
I found thumbnails of confidential scans which I don't want stored. Have a look at the latest thumbnails, is there any reason why they should be backed up?
# find ~/.thumbnails/ -mindepth 1 -type f -size -50k -print -exec rm '{}' \; find ~/.thumbnails/ -mindepth 1 -type f -mtime +30 -print -exec rm '{}' \;
I have ~180 MB here.
the same question, any reason for keeping them?
# find ~/.local/share/RecentDocuments/ -type f -print -exec rm '{}' \; find ~/.local/share/okular/docdata/ -type f -print -exec rm '{}' \; #
This one I want, they are only .desktop files, small. I wonder if there isn't already a tool to purge old "temporary" files like cache or thumbnails. If it doesn't exist, it should. My entire .cache directory has 12 GB. Biggest ones in mozilla, thumbnails and thunderbird. But I do not see old files in a quick check.
Well, in my Firefox the cache is 245KB(!) I have set up the Fox to to remove all cookies and cached data when closing. cu Peter
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Daniel Bauer
-
Peter McD